From e6fbab42185f4fb4e3a3b1e3e93eaa5d3d81b7c7 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 20 Dec 2025 17:59:40 +0100 Subject: backend: unify pass memory allocation strategies It was all over the place for temporary data structures used by individual passes. Now there is an arena specifically for that, which is nicer. --- x86_64/isel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'x86_64/isel.c') diff --git a/x86_64/isel.c b/x86_64/isel.c index 2b087cd..bc49d03 100644 --- a/x86_64/isel.c +++ b/x86_64/isel.c @@ -627,7 +627,7 @@ x86_64_isel(struct function *fn) struct block *blk = fn->entry; fn->stksiz = 0; - stkslots = xcalloc((nstkslots = ninstr) * sizeof *stkslots); + stkslots = allocz(fn->passarena, (nstkslots = ninstr) * sizeof *stkslots, 0); do { int i; for (i = 0; i < blk->phi.n; ++i) { @@ -649,7 +649,6 @@ x86_64_isel(struct function *fn) } seljmp(fn, blk); } while ((blk = blk->lnext) != fn->entry); - free(stkslots); if (ccopt.dbg.i) { bfmt(ccopt.dbgout, "<< After isel >>\n"); -- cgit v1.2.3