From 71c96b0ecd2f515fc5cfe545f6f7ed5ea40d9469 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 20 Feb 2023 16:43:54 +0100 Subject: Seems to work WHY WAS THIS SO EASY?! I spent basically the entire last week trying to build a reference based garbage collector wtf fuck that --- src/term.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/term.c') diff --git a/src/term.c b/src/term.c index 99fea0f..a88a2f7 100644 --- a/src/term.c +++ b/src/term.c @@ -94,7 +94,7 @@ void to_bruijn(struct term *term) struct term *new_term(term_type type) { - struct term *term = gc_calloc(&gc, 1, sizeof(*term)); + struct term *term = GC_malloc(sizeof(*term)); if (!term) { fprintf(stderr, "Out of memory!\n"); abort(); @@ -155,15 +155,15 @@ void free_term(struct term *term) switch (term->type) { case ABS: free_term(term->u.abs.term); - gc_free(&gc, term); + GC_free(term); break; case APP: free_term(term->u.app.lhs); free_term(term->u.app.rhs); - gc_free(&gc, term); + GC_free(term); break; case VAR: - gc_free(&gc, term); + GC_free(term); break; default: fprintf(stderr, "Invalid type %d\n", term->type); -- cgit v1.2.3