diff options
Diffstat (limited to 'builtins.c')
-rw-r--r-- | builtins.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -8,7 +8,7 @@ #define BuiltinProto(name) int name(Term *, Binding **, Module *) #define Match(X, Y) (runestrcmp(name, X) == 0 && arity == Y) #define Throw(What) do{\ - Goal *g = malloc(sizeof(Goal)); \ + Goal *g = gmalloc(sizeof(Goal)); \ g->goal = What; \ g->module = usermodule; \ g->catcher = nil; \ @@ -504,14 +504,14 @@ builtincatch(Term *goal, Binding **bindings, Module *module) Term *catcher = catchgoal->next; Term *recover = catcher->next; - Goal *catchframe = malloc(sizeof(Goal)); + Goal *catchframe = gmalloc(sizeof(Goal)); catchframe->goal = recover; catchframe->module = module; catchframe->catcher = catcher; catchframe->next = goalstack; goalstack = catchframe; - Goal *g = malloc(sizeof(Goal)); + Goal *g = gmalloc(sizeof(Goal)); g->goal = catchgoal; g->module = module; g->catcher = nil; @@ -543,7 +543,7 @@ builtinthrow(Term *goal, Binding **bindings, Module *module) return 0; }else{ goalstack = g->next; - Goal *newgoal = malloc(sizeof(Goal)); + Goal *newgoal = gmalloc(sizeof(Goal)); newgoal->goal = copyterm(g->goal, nil); newgoal->module = module; newgoal->catcher = nil; |