void juGC_store (juc* root, juc value) { *root = value; if (gc_began) if (ju_is_gc(value)) make_grey((ju_obj*) value); }
static void make_black (ju_obj* obj) { if (obj->gc_info.color == GREY) { obj->gc_info.color = BLACK; move_to_set(obj, &gc_sets[BLACK]); ju_int i, nmems; for (i = 0, nmems = obj->nmems; i < nmems; i++) if (ju_is_gc(obj->mems[i])) make_grey((ju_obj*) obj->mems[i]); } }
void juGC_begin () { gc_began = true; // each object is colored white at this point size_t i; juc cell; // mark each object in the root set for (i = 0; i < gc_roots.size; i++) { cell = *gc_roots.list[i]; if (ju_is_gc(cell)) make_grey((ju_obj*) cell); } }
void shade(GCMarker* marker) { if(marker->colour == kGCColourWhite) make_grey(marker); }