为什么Jonker的算法(标记 - 复杂)不需要额外的空间?
我正在从“垃圾收集手册:自动内存管理的艺术”一书中学习标记算法。
对于LISP 2算法,它说:
LISP 2算法的主要缺点是,它需要每个对象标头中的额外的全槽字段才能存储要移动对象的地址;
对于Jonker的算法,它说:
螺纹需要在对象标头中有足够的空间来存储一个地址(如有必要,覆盖其他数据),这不是一个繁重的要求,并且可以将指针与其他值区分开,这可能更难。
我令人困惑的是,由于两种算法都需要使用额外的空间来存储地址,所以为什么说乔克的算法不需要额外的空间?
I'm learning the mark-compaction algorithm from the book "The Garbage Collection Handbook: The Art of Automatic Memory Management".
For the Lisp 2 algorithm, it says:
The chief drawback of the Lisp 2 algorithm is that it requires an additional full-slot field in every object header to store the address to which the object is to be moved;
For the Jonker's algorithm, it says:
Threading needs there to be sufficient room in object headers to store an address (if necessary overwriting other data), which is not an onerous requirement, and that pointers can be distinguished from other values, which may be harder.
What I'm confusing is, since both algorithms need to use extra space to store addresses, why do you say that Jonker's algorithm doesn't need extra space?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解释说:如果可以将其视为地址,则该地址可能会覆盖现有数据。
[因此,这与记忆块至少与指针一样大,并且应该有一个保留的位或等效。]
The explanation says it: the address may overwrite existing data, provided it can be recognized as being an address.
[Hence this works with memory chunks at least as large as a pointer, and there should be a reserved bit or equivalent.]