Re:Mimalloc – A compact general-purpose allocator
by emeryberger on Saturday June 22, 2019 @07:43PM
(#20252369)
All modern allocator implementations I am aware of (including Hoard and Mesh) use per-thread caches (of a limited size), and thus avoid the use of atomic operations in the common case while also avoiding blowup (wasted memory caused by using a memory allocator that "leaks" -- see the Hoard paper (ASPLOS 2000, https://people.cs.umass.edu/~emery/pubs/berger-asplos2000.pd...) for a full discussion).
Re:Mimalloc – A compact general-purpose allocator
by pizlonator on Saturday June 22, 2019 @09:43PM
(#20252766)
Does hoard avoid atomic ops on the common case of both malloc and free?
Many mallocs implementations try to avoid one cache per thread because it can waste a huge amount of memory in applications with thousands of threads opting for per cpu pools or similar solutions. These solutions help with contention but still require atomics (unless using something like restartable sequences).
It is a trade-off, but for applications that use one thread per cpu, completely private free lists can branch win of course.