diff --git a/gc.c b/gc.c index e9482e5b..4ffe0301 100644 --- a/gc.c +++ b/gc.c @@ -432,14 +432,6 @@ char *gc_copy_obj(object dest, char *obj, gc_thread_data * thd) } return (char *)hp; } - case closure0_tag:{ - closure0_type *hp = dest; - mark(hp) = thd->gc_alloc_color; - type_of(hp) = closure0_tag; - hp->fn = ((closure0) obj)->fn; - hp->num_args = ((closure0) obj)->num_args; - return (char *)hp; - } case pair_tag:{ list hp = dest; hp->hdr.mark = thd->gc_alloc_color; @@ -558,6 +550,7 @@ char *gc_copy_obj(object dest, char *obj, gc_thread_data * thd) case primitive_tag: case boolean_tag: case symbol_tag: + case closure0_tag: break; case integer_tag:{ integer_type *hp = dest; @@ -974,8 +967,6 @@ size_t gc_allocated_bytes(object obj, gc_free_list * q, gc_free_list * r) } if (t == double_tag) return gc_heap_align(sizeof(double_type)); - if (t == closure0_tag) - return gc_heap_align(sizeof(closure0_type)); if (t == closure1_tag) return gc_heap_align(sizeof(closure1_type)); if (t == string_tag) { diff --git a/include/cyclone/types.h b/include/cyclone/types.h index d3d2e8e7..0da9c00d 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -1002,11 +1002,10 @@ typedef closure0_type *macro; c.fn = f; \ c.num_args = -1; -/* #define mclosure0(c, f) \ - static closure0_type c = { .hdr.mark = gc_color_red, .hdr.grayed = 0, .tag = closure0_tag, .fn = f, .num_args = -1 }; / * TODO: need a new macro that initializes num_args * / - */ + static closure0_type c = { .hdr.mark = gc_color_red, .hdr.grayed = 0, .tag = closure0_tag, .fn = f, .num_args = -1 }; /* TODO: need a new macro that initializes num_args */ +/* #define mclosure0(c,f) \ closure0_type c; \ c.hdr.mark = gc_color_red; \ @@ -1014,6 +1013,7 @@ typedef closure0_type *macro; c.tag = closure0_tag; \ c.fn = f; \ c.num_args = -1; +*/ #define maclosure0(c,f,na) \ closure0_type c; \ diff --git a/runtime.c b/runtime.c index dcd7406b..1513deda 100644 --- a/runtime.c +++ b/runtime.c @@ -4718,11 +4718,6 @@ char *gc_move(char *obj, gc_thread_data * thd, int *alloci, int *heap_grown) obj, thd, heap_grown); return gc_fixup_moved_obj(thd, alloci, obj, hp); } - case closure0_tag:{ - closure0_type *hp = - gc_alloc(heap, sizeof(closure0_type), obj, thd, heap_grown); - return gc_fixup_moved_obj(thd, alloci, obj, hp); - } case pair_tag:{ list hp = gc_alloc(heap, sizeof(pair_type), obj, thd, heap_grown); return gc_fixup_moved_obj(thd, alloci, obj, hp); @@ -4783,6 +4778,8 @@ char *gc_move(char *obj, gc_thread_data * thd, int *alloci, int *heap_grown) gc_alloc(heap, sizeof(c_opaque_type), obj, thd, heap_grown); return gc_fixup_moved_obj(thd, alloci, obj, hp); } + case closure0_tag: + break; case forward_tag: return (char *)forward(obj); case eof_tag: @@ -4927,7 +4924,6 @@ int gc_minor(void *data, object low_limit, object high_limit, closure cont, break; } // No child objects to move - case closure0_tag: case macro_tag: case bytevector_tag: case string_tag: @@ -4943,6 +4939,7 @@ int gc_minor(void *data, object low_limit, object high_limit, closure cont, case primitive_tag: case symbol_tag: case boolean_tag: + case closure0_tag: default: fprintf(stderr, "GC: unexpected object type %d for object %p\n", type_of(obj),