From dd68bf698a5618226fb3807d752c4ff73966cb5f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 9 Nov 2009 17:33:46 -0800 Subject: Changing representation of objects to allow the NUM type to be unboxed. If the lowest bit of the obj_t * pointer is 1, then the remaining bits are a number. A lot of assumptions are made: - the long type can be converted to and from a pointer - two's complement. - behavior of << and >> operators when the sign bit is involved. --- gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index efc135e0..4d19fedf 100644 --- a/gc.c +++ b/gc.c @@ -189,7 +189,7 @@ tail_call: #define mark_obj_tail(o) return mark_obj(o) #endif - if (obj == nil) + if (!is_ptr(obj)) return; t = obj->t.type; @@ -380,7 +380,7 @@ int gc_is_reachable(obj_t *obj) { type_t t; - if (obj == nil) + if (!is_ptr(obj)) return 1; t = obj->t.type; -- cgit v1.2.3