diff options
author | Marvin Borner | 2023-02-20 16:43:54 +0100 |
---|---|---|
committer | Marvin Borner | 2023-02-20 16:44:34 +0100 |
commit | 71c96b0ecd2f515fc5cfe545f6f7ed5ea40d9469 (patch) | |
tree | 71a7ad3d2b10d126afabefac183e48ae081e12f8 /src/term.c | |
parent | a162fdc74abf0686ec06e65e06d67a8ce5c13b30 (diff) |
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
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); |