summaryrefslogtreecommitdiff
path: root/module.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 /module.c
parent96639193bad1db5ff22f17bacbcd4eeecd024ba9 (diff)
Add a mark-sweep garbage collector
Diffstat (limited to 'module.c')
-rw-r--r--module.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/module.c b/module.c
index 8325fc9..45d0797 100644
--- a/module.c
+++ b/module.c
@@ -56,7 +56,7 @@ parsemodule(char *file)
Predicate *currentpred = nil;
Term *t;
for(t = terms; t != nil; t = t->next){
- Clause *cl = malloc(sizeof(Clause));
+ Clause *cl = gmalloc(sizeof(Clause));
int arity;
cl->clausenr = 0;
cl->next = nil;
@@ -78,7 +78,7 @@ parsemodule(char *file)
m->predicates = appendpredicate(currentpred, m->predicates);
else
usermodule->predicates = appendpredicate(currentpred, usermodule->predicates);
- currentpred = malloc(sizeof(Predicate));
+ currentpred = gmalloc(sizeof(Predicate));
currentpred->name = cl->head->text;
currentpred->arity = arity;
currentpred->clauses = cl;
@@ -109,7 +109,7 @@ getmodule(Rune *name)
Module *
addemptymodule(Rune *name)
{
- Module *m = malloc(sizeof(Module));
+ Module *m = gmalloc(sizeof(Module));
m->name = name;
m->next = modules;