This is an implementation of the memory allocator discussed in the Crafting Memory Allocators blog post.
The build and benchmarks were tested on macOS.
cmake -B build-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O3 -flto" .
make -C build-release
cmake -B build-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-O0 -g3" .
make -C build-debug
std::deque<T>
build-release/benchmark-deque
std::list<T>
build-release/benchmark-list
std::list<T>
with longstd::string
build-release/benchmark-list-huge-element
std::map<K, V>
build-release/benchmark-map
std::unordered_map<K, V>
build-release/benchmark-unordered-map
std::vector<V>
build-release/benchmark-vector
DYLD_INSERT_LIBRARIES=./build-release/libmalloc_replacement.dylib DYLD_FORCE_FLAT_NAMESPACE=1 <command>