简体   繁体   中英

Why Jonker's algorithm(mark-compaction) doesn't need extra space?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM