mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-21 22:59:16 +02:00
Revised marking section
This commit is contained in:
parent
4e76d52470
commit
c8045f42e1
1 changed files with 10 additions and 7 deletions
|
@ -87,13 +87,8 @@ Each thread has its own instance of the thread data structure and its own stack
|
||||||
Each object contains a header with the following information:
|
Each object contains a header with the following information:
|
||||||
|
|
||||||
- Tag - A number indicating the object type: cons, vector, string, etc.
|
- Tag - A number indicating the object type: cons, vector, string, etc.
|
||||||
- Mark - The status of the object's memory. Possible values are:
|
- Mark - The status of the object's memory.
|
||||||
- Blue - Unallocated memory.
|
- Grayed - A field indicating the object has been grayed but has not been added to a mark buffer yet (see major GC sections below). This is only applicable for objects on the stack.
|
||||||
- Red - Objects on the stack.
|
|
||||||
- White - Heap memory that has not been scanned by the collector.
|
|
||||||
- Gray - Objects marked by the collector that may still have child objects that must be marked.
|
|
||||||
- Black - Objects marked by the collector whose immediate child objects have also been marked.
|
|
||||||
- Grayed - A field indicating the object has been grayed but has not been added to a mark buffer yet. This is only applicable for objects on the stack.
|
|
||||||
|
|
||||||
## Mark Buffers
|
## Mark Buffers
|
||||||
|
|
||||||
|
@ -134,6 +129,14 @@ A single heap is used to store objects relocated from the various thread stacks.
|
||||||
|
|
||||||
## Tri-color Marking
|
## Tri-color Marking
|
||||||
|
|
||||||
|
An object can be marked using any of the following colors to indicate the status of its memory:
|
||||||
|
|
||||||
|
- Blue - Unallocated memory.
|
||||||
|
- Red - An object on the stack.
|
||||||
|
- White - Heap memory that has not been scanned by the collector.
|
||||||
|
- Gray - Objects marked by the collector that may still have child objects that must be marked.
|
||||||
|
- Black - Objects marked by the collector whose immediate child objects have also been marked.
|
||||||
|
|
||||||
Only objects marked as white, gray, or black participate in major collections:
|
Only objects marked as white, gray, or black participate in major collections:
|
||||||
|
|
||||||
- White objects are freed during the sweep state. White is sometimes also referred to as the clear color.
|
- White objects are freed during the sweep state. White is sometimes also referred to as the clear color.
|
||||||
|
|
Loading…
Add table
Reference in a new issue