srdja/Collections-C
FreeA library of generic data structures for the C language.
About srdja/Collections-C
Collections-C is a C language library providing a range of generic, reusable data structures. It includes pointer containers (storing void* pointers) such as dynamic arrays (CC_Array), doubly and singly linked lists (CC_List, CC_SList), deques, hash tables, tree tables, sets, queues, stacks, priority queues, ring buffers, and ternary search tree tables. Sized containers store data of arbitrary length directly (e.g., CC_SizedArray). Memory pools (CC_DynamicPool, CC_StaticPool) enable pre-allocated memory blocks for performance-critical applications. The library emphasizes efficiency with constant or logarithmic time operations for common use cases and is designed for easy integration into C projects via CMake build system.
Key Features
Pros & Cons
- Comprehensive collection of data structures covering most common needs
- Well-documented API with usage examples
- Memory pool support for fine-grained memory management
- Open source with active community (3k stars, 332 forks)
- Portable C code (no external dependencies beyond standard C)
- C language only – not directly usable from C++ or other languages without wrappers
- No built-in thread safety; concurrency must be handled externally
- Limited to pointer-based or sized containers; no built-in support for custom allocators beyond memory pools
- Documentation is mostly in code comments and README; may lack extensive tutorials