summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-09 17:33:46 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-09 17:33:46 -0800
commitdd68bf698a5618226fb3807d752c4ff73966cb5f (patch)
treec2da5348387f6c75aa225f00ecbc5b2f7e198788 /gc.c
parent357121301094005f6c56471fb18f9ff1b6bc8d13 (diff)
downloadtxr-dd68bf698a5618226fb3807d752c4ff73966cb5f.tar.gz
txr-dd68bf698a5618226fb3807d752c4ff73966cb5f.tar.bz2
txr-dd68bf698a5618226fb3807d752c4ff73966cb5f.zip
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.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 2 insertions, 2 deletions
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;