Fast and effective memory pool allocator for C / C++
Memory pool allocator. C / C++.
Optimized for quick alloc, realloc, free.
The allocated memory is always 16 bytes aligned.
You can use DKMalloc for your project.
Build DKMalloc as a shared library / DLL for C projects that can not use C++.
(essential functions are defined as C-linkage)
This is simplified ‘Memory Allocator’ part of DKGL.
Full version of DKGL: https://github.com/DKGL/DKGL
Choose which allocator to test.
#define TEST_SYSTEM_DEFAULT_MALLOC 1
#define TEST_TBB_SCALABLE_ALLOCATOR 1
Decide testing for small blocks or large blocks at main.cpp line 17
#define TEST_LARGE_BLOCKS 0 // set 1 to test large-blocks
Adjust allocation unit count at main.cpp line 19 or 20
#define NUM_ALLOCATIONS_SMALL_BLOCKS 20000000 // num allocs for small blocks
#define NUM_ALLOCATIONS_LARGE_BLOCKS 1000000 // num allocs for large blocks
BSD 3