From 08ee01ea9e6bd1bedd565f9e0e1c1a8938710887 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 8 Dec 2009 13:48:19 -0800 Subject: All COBJ operations have default implementations now; no null pointer check over struct cobj_ops operations. New typechecking function for COBJ objects. --- gc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 1a48ab2f..2a659e2b 100644 --- a/gc.c +++ b/gc.c @@ -196,14 +196,17 @@ static void finalize(val obj) case LSTR: return; case COBJ: - if (obj->co.ops->destroy) - obj->co.ops->destroy(obj); + obj->co.ops->destroy(obj); return; } assert (0 && "corrupt type field"); } +void cobj_destroy_op(val obj) +{ +} + static void mark_obj(val obj) { type_t t; @@ -272,14 +275,17 @@ tail_call: mark_obj(obj->ls.opts); mark_obj_tail(obj->ls.list); case COBJ: - if (obj->co.ops->mark) - obj->co.ops->mark(obj); + obj->co.ops->mark(obj); mark_obj_tail(obj->co.cls); } assert (0 && "corrupt type field"); } +void cobj_mark_op(val obj) +{ +} + static int in_heap(val ptr) { heap_t *heap; -- cgit v1.2.3