Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Region-based Memory Management (stephanboyer.com)
2 points by nkurz on Oct 19, 2013 | hide | past | favorite | 1 comment


A question:

For sticky situation #1 ("You make a reference to some memory allocated to a region and try to use it outside the region."), the solution is reference counting - ("When we leave the region and it’s time to deallocate the memory, we raise an error if the reference count is greater than zero.")

How does this work with circular references? I think, if I understood it correctly, that if you had a circularly referenced data structure you would get a RuntimeError as soon as the MemoryAllocator goes out of scope, as the reference count would be >0.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: