Container library, second attempt

J

jacob navia

In this thread I present a version of the container library.

I would like to emphasize that this proposal has two facets:

(1) An INTERFACE for container objects
(2) A sample implementation of the interface

Note that the sample implementation's objective is to prove that the
interface is sound and give a means to test it. It can be used as a starting
point for more performant constructions, that keep the interface but
improve speed, memory footprint, etc.

The design decisions that go into the code of the sample implementation
are
(1) Keep the code as small and readable as possible
(2) Minimize memory footprint: single linked lists,
no allocation in prevision of further allocs, etc.

Nevertheless, the list code (as unoptimized as it is) is
approx 10-15% faster than fully optimized STL. This shows
the power of C and its potential.

The code defaults to:

NO_C99 for maximum portability
NO_GC for implementations that do not have a garbage collector.

You can change those values in the "containers.h" header

The code compiles cleanly with gcc (-O2 -Wall -pedantic)
and Microsoft MSVC. (I used 2005 but all other versions should
do). For UNIX users please -DUNIX to change the name of
stricmp to strcasecmp.


Thanks for your attention and I hope this time it is better than the
last time

jacob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top