From d0816a8d75c4d620d3f9868be45f3a7707ad24b2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 2 Mar 2014 13:46:30 -0800 Subject: Bugfix: catenated stream objects not hooked into garbage collector, causing premature collection of the catenated stream list. * stream.c (cat_mark): new function. (cat_stream_ops): use cat_mark for gc mark function. --- ChangeLog | 8 ++++++++ stream.c | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9f6ea743..d85e5000 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-03-02 Kaz Kylheku + + Bugfix: catenated stream objects not hooked into garbage collector, + causing premature collection of the catenated stream list. + + * stream.c (cat_mark): new function. + (cat_stream_ops): use cat_mark for gc mark function. + 2014-03-01 Kaz Kylheku New quasiquote idea: let's have two quasiquote macros sharing one diff --git a/stream.c b/stream.c index d80c87c7..3a3d2d77 100644 --- a/stream.c +++ b/stream.c @@ -2336,11 +2336,17 @@ static val cat_get_prop(val stream, val ind) return nil; } +static void cat_mark(val stream) +{ + val obj = (val) stream->co.handle; + gc_mark(obj); +} + static struct strm_ops cat_stream_ops = { { eq, cat_stream_print, cobj_destroy_stub_op, - cobj_mark_op, + cat_mark, cobj_hash_op }, 0, /* put_string */ 0, /*_put_char */ -- cgit v1.2.3