diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-09-12 07:02:35 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-09-12 07:02:35 -0700 |
commit | a83cb6c26b024d4050e1bb6fb21145f02d762657 (patch) | |
tree | cb19abf19316a89fad67b842a303bd898a5fcbd1 | |
parent | 260662d47b30a0e43d23df45ada15a4b28108256 (diff) | |
download | txr-a83cb6c26b024d4050e1bb6fb21145f02d762657.tar.gz txr-a83cb6c26b024d4050e1bb6fb21145f02d762657.tar.bz2 txr-a83cb6c26b024d4050e1bb6fb21145f02d762657.zip |
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.
-rw-r--r-- | gc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) { |