summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index eafc354c..5fbf5c88 100644
--- a/gc.c
+++ b/gc.c
@@ -497,6 +497,43 @@ tail_call:
assert (0 && "corrupt type field");
}
+static void mark_obj_norec(val obj)
+{
+ type_t t;
+
+ if (!is_ptr(obj))
+ return;
+
+ t = obj->t.type;
+
+ if ((t & REACHABLE) != 0)
+ return;
+
+#if CONFIG_GEN_GC
+ if (!full_gc && obj->t.gen > 0)
+ return;
+#endif
+
+ if ((t & FREE) != 0)
+ abort();
+
+#if CONFIG_GEN_GC
+ if (obj->t.gen == -1)
+ obj->t.gen = 0; /* Will be promoted to generation 1 by sweep_one */
+#endif
+
+ obj->t.type = convert(type_t, t | REACHABLE);
+
+#if CONFIG_EXTRA_DEBUGGING
+ if (obj == break_obj) {
+#if HAVE_VALGRIND
+ VALGRIND_PRINTF_BACKTRACE("object %p marked\n", convert(void *, obj));
+#endif
+ breakpt();
+ }
+#endif
+}
+
void cobj_mark_op(val obj)
{
(void) obj;
@@ -959,6 +996,11 @@ void gc_mark(val obj)
mark_obj(obj);
}
+void gc_mark_norec(val obj)
+{
+ mark_obj_norec(obj);
+}
+
void gc_conservative_mark(val maybe_obj)
{
mark_obj_maybe(maybe_obj);