logoalt Hacker News

senderista • today at 4:38 AM • 3 replies • view on HN

It was a good single-threaded allocator back in the day but in the multicore era the design is now thoroughly obsolete. I suggest reading e.g. the jemalloc[1] and mimalloc[2] papers if you want to understand how modern allocators are implemented.

[1] https://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemal...

[2] https://www.microsoft.com/en-us/research/wp-content/uploads/...


Replies

HexDecOctBin • today at 5:36 AM

Considering that global allocators are usually an anti-pattern and that most applications should have component-specific allocators, dlmalloc isn't all that bad when used through its mspace API. Of course, if one doesn't actually need a general allocator, they should simply use an arena allocator.

➕ show 1 reply
jart • today at 6:58 AM

Cosmopolitan uses dlmalloc and just wraps it with an rseq allocator for multicore performance. See also https://jart.dev/rseq/

brcmthrowaway • today at 6:13 AM

Has anyone tried jev as an allocator?

➕ show 1 reply