A collection of small C libraries.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Marc Sunet e504a003cf Lower cmake version to 3.0 11 months ago
include Initial commit. 1 year ago
src Initial commit. 1 year ago
test Initial commit. 1 year ago
CMakeLists.txt Lower cmake version to 3.0 11 months ago
README.md Initial commit. 1 year ago



A memory pool implementation.

Each block in the pool is tagged with a boolean value that indicates whether the block is free or in use. The allocator otherwise maintains little additional information. Therefore, some operations have linear-time complexity. Specifically:

  • Allocating a block scans the pool for the next free block in linear time.
  • Freeing a block runs in constant time.
  • Iterating over the pool's used blocks is linear over the number of blocks in the pool, as opposed to just the number of used blocks.

The allocator's internal data is also stored separately from the main array of blocks so that the block data remains tightly packed.

For convenience of programming and debugging, free blocks in the mempool always remain zeroed out. If your data structures are valid when zeroed out, then you do not need to explicitly initialize them.