Hacker News new | ask | show | jobs
by mathiasgredal 916 days ago
Why is this better than an arena style allocator?
2 comments

It is an arena-style allocator.

At least, if someone asked me to explain what an arena allocator is/does, I would say essentially what they wrote -- likely without the "disappears automatically once all references disappear" part, which is IMHO just a clever nice-to-have.

You allocate a large lump of memory up front and supply parts of it on demand. This would be different from an allocator which may allocate smaller amounts of memory as needed. This can help reduce memory fragmentation.

It also helps to bound your memory usage. A request could block until memory was free.