mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Revised sweep section
This commit is contained in:
parent
bbe60ed4c2
commit
b03cb72388
1 changed files with 5 additions and 3 deletions
|
@ -228,12 +228,12 @@ The collector finds all live objects using a breadth-first search and marks them
|
|||
<img src="images/gc-graph-trace.png" alt="Initial object graph">
|
||||
|
||||
### Sweep
|
||||
The collector scans the heap and frees memory used by all white objects:
|
||||
This function is included here for completeness but is actually performed much later due to [lazy sweeping](#lazy-sweeping).
|
||||
|
||||
When the time comes to reclaim memory a mutator scans a heap page and frees memory used by any of the white objects:
|
||||
|
||||
<img src="images/gc-graph-sweep.png" alt="Initial object graph">
|
||||
|
||||
If the heap is still low on memory at this point the heap will be increased in size. Also, to ensure a complete collection, data for any terminated threads is not freed until now.
|
||||
|
||||
### Resting
|
||||
The collector cycle is complete and it rests until it is triggered again.
|
||||
|
||||
|
@ -304,6 +304,8 @@ In addition when a mutator transitions to async it will:
|
|||
|
||||
Cyclone's mutators cooperate after each minor GC, for two reasons. Minor GC's are frequent and immediately afterwards all of the mutator's live objects can be marked because they are on the heap.
|
||||
|
||||
Finally, at the end of a collection cycle the main thread must clean up heap data for any terminated threads.
|
||||
|
||||
### Mark Gray
|
||||
|
||||
Mutators call this function to add an object to their mark buffer.
|
||||
|
|
Loading…
Add table
Reference in a new issue