I try and plug http://concurrencykit.org/ whenever I see someone looking for something like this. It's built around providing portable atomic intrinsics for parallel code, but the data structures are also very well done and work just as nicely for single threaded code.
Collections-C, generic data structures for C
11–20 of 63 posts
Re: Collections-C, generic data structures for C
#12Has this library been stress tested? I am interested in using this library for a spaceflight application, but reliability is paramount in our situation.
Re: Collections-C, generic data structures for C
#13Has this library been stress tested? I am interested in using this library for a spaceflight application, but reliability is paramount in our situation.
I stopped looking when I saw it doesn't check for malloc failure. I am going to say space flight is a no-go.
Re: Collections-C, generic data structures for C
#14It looks like all collections store void pointers. I don't see any abstractions to help with pointer lifetimes, which remains the main problem I encounter when trying to write large programs in C that dynamically allocate memory.
Start using arenas wherever you can. Makes memory management in C programs substantially simpler.
Re: Collections-C, generic data structures for C
#15Re: Collections-C, generic data structures for C
#16http://git.savannah.gnu.org/cgit/kazlib.git/tree/
http://www.kylheku.com/~kaz/kazlib.html
Used in e2fsck since 2002: http://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/commit/e2fs...
Re: Collections-C, generic data structures for C
#17https://github.com/srdja/Collections-C/blob/master/src/hasht... shows the container is manually configurable. Look at the defines at the bottom. This would mean the container file source-header pair, would have to be duplicated for every type, which is somewhat manageable.
Why isn't this written in the readme?
Re: Collections-C, generic data structures for C
#18Earlier quoted context omitted.
Start using arenas wherever you can. Makes memory management in C programs substantially simpler.
Any good readings on getting started with arenas?
Re: Collections-C, generic data structures for C
#19Earlier quoted context omitted.
I stopped looking when I saw it doesn't check for malloc failure. I am going to say space flight is a no-go.
But for this kind of application, wouldn't you just panic and do a soft restart on malloc failure anyway? Actually recovering from an out-of-memory situation is incredibly fraught and unreliable; most of the realtime operating systems I've used don't even bother to try.
Re: Collections-C, generic data structures for C
#20Has this library been stress tested? I am interested in using this library for a spaceflight application, but reliability is paramount in our situation.