Get the latest tech news
Baby’s Second Garbage Collector
This blog post is meant to an iteration on the tutorial and introduction to garbage collection implementation presented in this classic blog post. We are still working with simple garbage collectors, but this time another one with a bit more complexity.
This property makes this allocator-pattern genuinely useful for situations like web-servers or video games, where a request or individual frame might generate large amounts of data that is not meaningful useful to keep around afterwards; the clear() operation would be much faster than attempting to deallocate each of the objects. That's kind of a scary amount of stuff to give up -- normally when we think of overhead or potentially unusable space, it's small little chunks that add up, not a huge compromise outright. Much like the original, this is a pretty trivial project and implementing this in production will probably run into huge number of bottlenecks and potential issues, but it's certainly not an unusable toy either -- this was cutting edge research at one point!
Or read this on Hacker News