From d8cfac38a20bd6a7c634168eb9cf86475c41ce70 Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 19 Jul 2021 04:41:01 +0300 Subject: [PATCH] move mut_pfree out of .c --- src/utils/mut.c | 6 +++++- src/utils/mut.h | 5 +---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/mut.c b/src/utils/mut.c index 50b3ad9c..0629c9dc 100644 --- a/src/utils/mut.c +++ b/src/utils/mut.c @@ -7,4 +7,8 @@ NOINLINE B vec_addR(B w, B x) { mut_setG(r, wia, x); dec(w); return mut_fv(r); -} \ No newline at end of file +} +NOINLINE void mut_pfree(Mut* m, usz n) { // free the first n elements + if (m->type==el_B) harr_pfree(taga(m->val), n); + else mm_free((Value*) m->val); +} diff --git a/src/utils/mut.h b/src/utils/mut.h index f971b621..0204db40 100644 --- a/src/utils/mut.h +++ b/src/utils/mut.h @@ -79,10 +79,7 @@ static u8 el_or(u8 a, u8 b) { #undef M } -static void mut_pfree(Mut* m, usz n) { // free the first n elements - if (m->type==el_B) harr_pfree(taga(m->val), n); - else mm_free((Value*) m->val); -} +void mut_pfree(Mut* m, usz n); static void mut_set(Mut* m, usz ms, B x) { // consumes x; sets m[ms] to x again: