This commit is contained in:
Justin Ethier 2016-01-21 20:07:00 -05:00
parent 299f325a4d
commit 3a02c50dba

View file

@ -8,6 +8,8 @@
- [Data Structures](#data-structures)
- [Heap](#heap)
- [Thread Data](#thread-data)
- [Object Header](#object-header)
- [Mark Buffers](#mark-buffers)
- [Minor Collection](#minor-collection)
- [Major Collection](#major-collection)
- [Tri-color Marking](#tri-color-marking)
@ -122,6 +124,8 @@ A minor collection is always performed for a single mutator thread, usually by t
- Cooperate with the collection thread (see next section).
- Perform a `longjmp` to reset the stack and call into the current continuation.
Any objects left on the stack after `longjmp` are considered garbage. There is no need to clean them up because the stack will just re-use the memory as it grows.
Finally, although not mentioned in Baker's paper, a heap object can be modified to contain a reference to a stack object. For example, by using a `set-car!` to change the head of a list. This is problematic since stack references are no longer valid after a minor GC. We account for these "mutations" by using a write barrier to maintain a list of each modified object. During GC, these modified objects are treated as roots to avoid dangling references.
# Major Collection