summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stream.c5
-rw-r--r--struct.c4
-rw-r--r--tree.c4
-rw-r--r--vm.c2
4 files changed, 13 insertions, 2 deletions
diff --git a/stream.c b/stream.c
index bf90613e..12644455 100644
--- a/stream.c
+++ b/stream.c
@@ -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 {
diff --git a/struct.c b/struct.c
index 5e8c7647..653311d3 100644
--- a/struct.c
+++ b/struct.c
@@ -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;
diff --git a/tree.c b/tree.c
index 01844931..8c0adb84 100644
--- a/tree.c
+++ b/tree.c
@@ -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;
}
diff --git a/vm.c b/vm.c
index 60203554..4928d577 100644
--- a/vm.c
+++ b/vm.c
@@ -317,6 +317,8 @@ val vm_copy_closure(val oclosure)
}
}
+ gc_hint(oclosure);
+
return nclosure;
}