summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-08 17:07:15 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-08 17:07:15 +0000
commit28e7dd47d568908702264977d70860c25467fb6e (patch)
tree61ec96a7ffc789fa518313ab5c78ead65d0db8a8 /misc.c
parent96639193bad1db5ff22f17bacbcd4eeecd024ba9 (diff)
Add a mark-sweep garbage collector
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 08aa339..fd74a82 100644
--- a/misc.c
+++ b/misc.c
@@ -8,7 +8,7 @@
Term *
copyterm(Term *orig, uvlong *clausenr)
{
- Term *new = malloc(sizeof(Term));
+ Term *new = gmalloc(sizeof(Term));
memcpy(new, orig, sizeof(Term));
new->next = nil;
new->children = nil;
@@ -47,7 +47,7 @@ termslength(Term *list)
Term *
mkterm(int tag)
{
- Term *t = malloc(sizeof(Term));
+ Term *t = gmalloc(sizeof(Term));
t->tag = tag;
t->next = nil;
t->children = nil;
@@ -142,7 +142,7 @@ mklist(Term *elems)
Clause *
copyclause(Clause *orig, uvlong *clausenr)
{
- Clause *new = malloc(sizeof(Clause));
+ Clause *new = gmalloc(sizeof(Clause));
new->head = copyterm(orig->head, clausenr);
if(orig->body)
new->body = copyterm(orig->body, clausenr);