diff options
-rw-r--r-- | stream.c | 5 | ||||
-rw-r--r-- | struct.c | 4 | ||||
-rw-r--r-- | tree.c | 4 | ||||
-rw-r--r-- | vm.c | 2 |
4 files changed, 13 insertions, 2 deletions
@@ -2243,12 +2243,13 @@ static struct strm_ops strlist_in_ops = val make_strlist_input_stream(val list) { - struct strlist_in *s = coerce(struct strlist_in *, chk_malloc(sizeof *s)); + struct strlist_in *s = coerce(struct strlist_in *, chk_calloc(sizeof *s, 1)); + val stream = cobj(coerce(mem_t *, s), stream_cls, &strlist_in_ops.cobj_ops); strm_base_init(&s->a); s->string = car(list); s->pos = zero; s->list = cdr(list); - return cobj(coerce(mem_t *, s), stream_cls, &strlist_in_ops.cobj_ops); + return stream; } struct string_out { @@ -856,6 +856,8 @@ static val make_struct_impl(val self, val type, uw_catch_end; + gc_hint(type); + return sinst; } @@ -947,6 +949,8 @@ val make_lazy_struct(val type, val argfun) bug_unless (type == st->self); + gc_hint(type); + si->slot[0] = argfun; return sinst; @@ -921,6 +921,7 @@ val copy_search_tree(val tree) val ntree = cobj(coerce(mem_t *, ntr), tree_cls, &tree_ops); *ntr = *otr; ntr->root = nroot; + gc_hint(tree); return ntree; } @@ -933,6 +934,7 @@ val make_similar_tree(val tree) *ntr = *otr; ntr->root = nil; ntr->size = ntr->max_size = 0; + gc_hint(tree); return ntree; } @@ -1014,6 +1016,8 @@ val copy_tree_iter(val iter) memcpy(tdid->ti.path, tdis->ti.path, sizeof tdid->ti.path[0] * depth); + gc_hint(iter); + return iter_copy; } @@ -317,6 +317,8 @@ val vm_copy_closure(val oclosure) } } + gc_hint(oclosure); + return nclosure; } |