From 960f79fa50009fd1e95a294547e3e46494d49484 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 17 Sep 2025 09:49:22 +0200 Subject: alloc changes --- regalloc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'regalloc.c') diff --git a/regalloc.c b/regalloc.c index 1018e7c..68d6592 100644 --- a/regalloc.c +++ b/regalloc.c @@ -780,20 +780,17 @@ linearscan(struct rega *ra) struct interval **unhandled = NULL; struct interval *active = NULL, *inactive = NULL, *handled = NULL; + if (!intervals->count) return; /* sort intervals */ { extern int ninstr; - unhandled = xcalloc(sizeof *unhandled * intervals->count); + unhandled = alloc(ra->arena, sizeof *unhandled * intervals->count, 0); for (int i = 0; i < ninstr; ++i) { if (!intervals->temps[i].nrange) continue; unhandled[nunhandled++] = &intervals->temps[i]; } assert(nunhandled == intervals->count); - if (!nunhandled) { - free(unhandled); - return; - } sortintervals(unhandled, 0, nunhandled-1); } @@ -954,8 +951,6 @@ linearscan(struct rega *ra) active = current; } } - - free(unhandled); } /* replace temps with physical regs, add loads & stores for spilled temps */ -- cgit v1.2.3