docs/index.html
Loading...
Searching...
No Matches
mi-malloc
This is the API documentation of the mimalloc allocator (pronounced "me-malloc") – a general purpose allocator with excellent performance characteristics. Initially developed by Daan Leijen for the run-time systems of the Koka and Lean languages.
It is a drop-in replacement for malloc and can be used in other programs without code changes, for example, on Unix you can use it as:
> LD_PRELOAD=/usr/bin/libmimalloc.so myprogram
Notable aspects of the design include:
free operations, and another one for concurrent free operations. Free-ing from another thread can now be a single CAS without needing sophisticated coordination between threads. Since there will be thousands of separate free lists, contention is naturally distributed over the heap, and the chance of contending on a single location will be low – this is quite similar to randomized algorithms like skip lists where adding a random oracle removes the need for a more complex algorithm.There are three maintained versions of mimalloc. All versions are mostly equal except for how the OS memory is handled. New development is mostly on v3, while v1 and v2 are maintained with security and bug fixes.
v1.9.x, development branch dev). Send PR's against this version if possible.v2.2.x, development branch dev2)v3.2.x, development branch dev3).You can read more on the design of mimalloc in the technical report which also has detailed benchmark results. To learn more about the internal implementation of mimalloc, see include/mimalloc/types.h.
Further information: