From a83cb6c26b024d4050e1bb6fb21145f02d762657 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 12 Sep 2019 07:02:35 -0700 Subject: gc: bug in determining tight heap bounding box. * gc.c (more): The heap_max_bound and heap_min_bound variables are initialized to null. We must update them unconditionally if they are in that state. What's happening otherwise is that heap_min_bound stays null and so we unnecessarily process false positives in the in_heap function. --- gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gc.c b/gc.c index 526e4a5c..1b3e68cd 100644 --- a/gc.c +++ b/gc.c @@ -140,10 +140,10 @@ static void more(void) if (free_list == 0) free_tail = &heap->block[0].t.next; - if (end > heap_max_bound) + if (!heap_max_bound || end > heap_max_bound) heap_max_bound = end; - if (block < heap_min_bound) + if (!heap_min_bound || block < heap_min_bound) heap_min_bound = block; while (block < end) { -- cgit v1.2.3