summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 33afca91..e42e7552 100644
--- a/gc.c
+++ b/gc.c
@@ -244,7 +244,7 @@ val make_obj(void)
static void finalize(val obj)
{
- switch (obj->t.type) {
+ switch (convert(type_t, obj->t.type)) {
case NIL:
case CONS:
case CHR:
@@ -280,6 +280,12 @@ static void finalize(val obj)
case BGNUM:
mp_clear(mp(obj));
return;
+ case BUF:
+ if (obj->b.size) {
+ free(obj->b.data);
+ obj->b.data = 0;
+ }
+ return;
}
assert (0 && "corrupt type field");
@@ -395,6 +401,9 @@ tail_call:
case RNG:
mark_obj(obj->rn.from);
mark_obj_tail(obj->rn.to);
+ case BUF:
+ mark_obj(obj->b.len);
+ mark_obj_tail(obj->b.size);
}
assert (0 && "corrupt type field");