diff options
author | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-08 17:07:15 +0000 |
---|---|---|
committer | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-08 17:07:15 +0000 |
commit | 28e7dd47d568908702264977d70860c25467fb6e (patch) | |
tree | 61ec96a7ffc789fa518313ab5c78ead65d0db8a8 /misc.c | |
parent | 96639193bad1db5ff22f17bacbcd4eeecd024ba9 (diff) |
Add a mark-sweep garbage collector
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |