void juGC_init_obj (ju_obj* obj) { juGC_sweep(); gc_nobjs++; obj->gc_info.prev = obj->gc_info.next = NULL; make_white(obj); }
Mesh create_mesh( const GLenum primitives ) { Mesh m; m.color= make_white(); m.primitives= primitives; m.vao= 0; m.program= 0; return m; }
void juGC_end () { size_t freed = 0; ju_obj* obj, * next; // remove remaining white objects for (obj = first(WHITE); obj != NULL; obj = next) { next = obj->gc_info.next; free(obj); freed++; } first(WHITE) = NULL; // color black objects white while (first(BLACK) != NULL) make_white(first(BLACK)); gc_began = false; // fprintf(stderr, "* freed %d/%d %d roots\n", // freed, gc_nobjs, gc_roots.size); gc_nobjs -= freed; }