From 3adf6fb1d29c58636783e52129afbb68a21223c2 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 10 Jan 2017 20:17:21 -0500 Subject: [PATCH] Explain mark phase --- docs/Writing-the-Cyclone-Scheme-Compiler-Revised-2017.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/Writing-the-Cyclone-Scheme-Compiler-Revised-2017.md b/docs/Writing-the-Cyclone-Scheme-Compiler-Revised-2017.md index 041bbe08..20ab26bd 100644 --- a/docs/Writing-the-Cyclone-Scheme-Compiler-Revised-2017.md +++ b/docs/Writing-the-Cyclone-Scheme-Compiler-Revised-2017.md @@ -259,7 +259,11 @@ The collector thread swaps the values of the clear color (white) and the mark co Initial object graph #### Mark -The collector thread transitions to sync 2 and then async. At this point it marks the global variables and waits for the application threads to also transition to async. When an application thread transitions it will mark its roots and use black as the allocation color to prevent any new objects from being collected during this cycle: +The collector thread transitions to sync 2 and then async. At this point it marks the global variables and waits for the application threads to also transition to async. When an application thread transitions it will: + +- Mark its roots black. +- Gray any child objects of the roots. The collector thread traces these gray objects during the next phase. +- Use black as the allocation color to prevent any new objects from being collected during this cycle. Initial object graph