3 ms·
You are correct. As I mentioned in https://news.ycombinator.com/item?id=11426339 https://news.ycombinator.com/item?id=11426339, jemalloc does this (http://linux
by Manishearth 11y ago
You are correct. As I mentioned in https://news.ycombinator.com/item?id=11426339 https://news.ycombinator.com/item?id=11426339, jemalloc does this (http://linux.die.net/man/3/jemalloc http://linux.die.net/man/3/jemalloc, see the implementation notes), and you can use it pervasively so that all your existing malloc-using code links to jemalloc instead of the regular malloc. Ultimately the allocation strategy is an orthogonal concern to garbage collection, it's just that many GCs spend a lot more time worrying about the allocation strategy since they need to.
It actually goes one step further than the TLH and does this round-robin stuff sharing the load between your processes.