Baby’s First Garbage Collector › 简单 Simple [#270]

你做到了!如果你跟着做了所有这些,那么你现在已经掌握了简单的垃圾回收算法。如果你想一次查看全部内容,在这里参阅完整代码。我在这里强调一下,虽然这个收集器很简单,但它不是一个玩具
You made it! If you followed all of this, you’ve now got a handle on a simple garbage collection algorithm. If you want to see it all together, here’s the full code. Let me stress here that while this collector is simple, it isn’t a toy.

你可以在此基础上构建大量优化⸺在垃圾回收和编程语言中,优化占了 90% 的工作量⸺但这里的核心代码是合法的真实垃圾回收器。它与直到最近的 Ruby 和 Lua 中的回收器都非常相似。你可以在生产代码中使用这样的代码。现在去构建一些很棒的东西吧!
There are a ton of optimizations you can build on top of this—in GCs and programming languages, optimization is 90