From c8045f42e192d47e6045bb588ab684204595799e Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 8 Feb 2016 19:33:32 -0500 Subject: [PATCH] Revised marking section --- docs/Garbage-Collector.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/Garbage-Collector.md b/docs/Garbage-Collector.md index 450bee26..aabeb244 100644 --- a/docs/Garbage-Collector.md +++ b/docs/Garbage-Collector.md @@ -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: - Tag - A number indicating the object type: cons, vector, string, etc. -- Mark - The status of the object's memory. Possible values are: - - Blue - Unallocated memory. - - 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 - The status of the object's 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. ## Mark Buffers @@ -134,6 +129,14 @@ A single heap is used to store objects relocated from the various thread stacks. ## 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: - White objects are freed during the sweep state. White is sometimes also referred to as the clear color.