Debugging GC.
authorTim Vaughan <tgvaughan@gmail.com>
Sun, 23 Oct 2016 03:16:36 +0000 (16:16 +1300)
committerTim Vaughan <tgvaughan@gmail.com>
Sun, 23 Oct 2016 03:16:36 +0000 (16:16 +1300)
scheme.4th

index 3c4744e..3c5c6a9 100644 (file)
@@ -166,18 +166,15 @@ false gc-enabled !
 
 : gc-mark-obj ( obj -- )
 
-    pairlike? if
-        pairlike-marked? if 2drop exit then
-            
-        mark-pairlike
+    pairlike? invert if 2drop exit then
+    pairlike-marked? if 2drop exit then
 
-        2dup
+    mark-pairlike
 
-        car recurse
-        cdr recurse
-    else
-        2drop
-    then
+    drop pair-type 2dup
+
+    car recurse
+    cdr recurse
 ;
 
 : gc-sweep