move mut_pfree out of .c

This commit is contained in:
dzaima 2021-07-19 04:41:01 +03:00
parent 0c04b7e03b
commit d8cfac38a2
2 changed files with 6 additions and 5 deletions

View File

@ -7,4 +7,8 @@ NOINLINE B vec_addR(B w, B x) {
mut_setG(r, wia, x);
dec(w);
return mut_fv(r);
}
}
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);
}

View File

@ -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: