Unofficial Hacker News companion — get notified on comment replies, and more.

Doug Lea's Malloc (opens external site)

52 points by grep_it 5 days ago | gee.cs.oswego.edu | 32 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (2)

  1. But it shouldn't take locks in your private arena?
    Replies (1)
    1. In typical modern allocators like jemalloc or tcmalloc[*], sharded arenas are protected by locks, but the assumption is that with enough sharding there won't be significant lock contention, and also that you can mostly avoid the locks with thread-local caches. (mimalloc uses thread-local arenas instead, so no locks are required for allocations, and atomic RMW ops for cross-thread frees.)

      * I'm ignoring rseq here for simplicity.