为什么Jonker的算法(标记 - 复杂)不需要额外的空间?

发布于 2025-02-09 17:22:44 字数 329 浏览 2 评论 0原文

我正在从“垃圾收集手册:自动内存管理的艺术”一书中学习标记算法。

对于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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

-柠檬树下少年和吉他 2025-02-16 17:22:44

解释说:如果可以将其视为地址,则该地址可能会覆盖现有数据。

[因此,这与记忆块至少与指针一样大,并且应该有一个保留的位或等效。]

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.]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文