Skip to content

KDABLabs/demo-memory-allocator-comparisons

Repository files navigation

Introduction

Repo for easily comparing different C++ memory allocators.

For now it checks the safety features. Jemalloc and mimalloc don't seem to be better than glibc at detecting crashes. Please improve the tests if you find cases that aren't caught by all 3.

Benchmarks and tcmalloc to be added.

Build

git submodule update --init --recursive
cmake --preset=debug
cmake --build build-debug
./run_example.sh --jemalloc ./build-debug/bin/demo_crash -d # double-free
./run_example.sh --jemalloc ./build-debug/bin/demo_crash -i # invalid pointer free
./run_example.sh --jemalloc ./build-debug/bin/demo_crash -u # use after free (not working)

You can pass --mimalloc, --asan or --glibc instead of --jemalloc.

About

Repo to compare performance and memory violation handling of each allocator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published