libdynamic is a single file header library designed to provide dynamic, performance optimized, low-level data structures for C.
Copy dynamic.h
to your header path and compile with -flto
to ensure link time optimizations.
The test suite requires cmocka and valgrind, and requires 100% line and branch coverage to succeed.
./configure
make check
libdynamic follows the semantic versioning scheme.
libdynamic is licensed under the zlib license.
Data containers are generic data containers reducing the need for the common use case of handling separate variables for pointers and size. Data vectors also remove the need for zero-terminated strings, and help reduce strlen() runtime usage.
UTF-8 compliant strings that store an explicit string length to avoid zero termination issues.
Vectors are dynamically resized arrays, similar to C++ std::vector, with O(1) random access, and O(1) inserts and removals at the end.
Lists are doubly linked sequence containers, similar to C++ std::list, with O(1) inserts (given a known position) and deletes.
Buffers offers generic data containers with dynamic memory allocation. Buffers can inserted into, erased from, resized and compacted, saved to and loaded from files.
Memory pools improves performance when frequently allocating and deallocating objects of a predetermined size.