logoalt Hacker News

HexDecOctBinyesterday at 3:06 AM1 replyview on HN

Yeah, but I am guessing one needs a bit more info on how this works together with GC. For example, once an arena goes out of scope, what happens to allocations made inside it that have been returned and thus are referred to from outside that scope? Are they copied out or do we have a dangling pointer? Stuff like this needs some decent documentation in order to be able to use a low level feature like this properly.


Replies

Jachyesterday at 9:21 AM

Indeed. The behavior of arenas shared by multiple threads is important as well, and the proper use of destroy-arena vs. rewind-arena. Without care it's easy to create a leak in the unmanaged memory and the OOM Killer will come for your process eventually.