diff --git a/gc.c b/gc.c index d8cd0074..5b7ac4c6 100644 --- a/gc.c +++ b/gc.c @@ -1103,6 +1103,22 @@ void gc_collector_trace() } } +static void gc_collector_mark_gray(object parent, object obj) +{ + // "Color" objects gray by adding them to the mark stack for further processing. + // + // Note that stack objects are always colored red during creation, so + // they should never be added to the mark stack. Which would be bad because it + // could lead to stack corruption. + if (is_object_type(obj) && mark(obj) == gc_color_clear) { + mark_stack = vpbuffer_add(mark_stack, &mark_stack_len, mark_stack_i++, obj); +#if GC_DEBUG_VERBOSE + fprintf(stderr, "mark gray parent = %p (%d) obj = %p\n", parent, + type_of(parent), obj); +#endif + } +} + // TODO: seriously consider changing the mark() macro to color(), // and sync up the header variable. that would make all of this code // bit clearer... @@ -1165,22 +1181,6 @@ void gc_mark_black(object obj) } } -void gc_collector_mark_gray(object parent, object obj) -{ - // "Color" objects gray by adding them to the mark stack for further processing. - // - // Note that stack objects are always colored red during creation, so - // they should never be added to the mark stack. Which would be bad because it - // could lead to stack corruption. - if (is_object_type(obj) && mark(obj) == gc_color_clear) { - mark_stack = vpbuffer_add(mark_stack, &mark_stack_len, mark_stack_i++, obj); -#if GC_DEBUG_VERBOSE - fprintf(stderr, "mark gray parent = %p (%d) obj = %p\n", parent, - type_of(parent), obj); -#endif - } -} - void gc_empty_collector_stack() { // Mark stack is only used by the collector thread, so no sync needed diff --git a/include/cyclone/types.h b/include/cyclone/types.h index cc339a4b..f98a9ce9 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -628,7 +628,6 @@ void gc_mark_gray(gc_thread_data * thd, object obj); void gc_mark_gray2(gc_thread_data * thd, object obj); void gc_collector_trace(); void gc_mark_black(object obj); -void gc_collector_mark_gray(object parent, object obj); void gc_empty_collector_stack(); void gc_handshake(gc_status_type s); void gc_post_handshake(gc_status_type s);