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 | 4edfb0c2b6a7b6e915cb6ce5083284e6502e5086 (patch) | |
tree | cb19abf19316a89fad67b842a303bd898a5fcbd1 /gc.c | |
parent | ead7c462846401cd3cb9e770b6ab1bae2fa9d7bb (diff) | |
download | txr-4edfb0c2b6a7b6e915cb6ce5083284e6502e5086.tar.gz txr-4edfb0c2b6a7b6e915cb6ce5083284e6502e5086.tar.bz2 txr-4edfb0c2b6a7b6e915cb6ce5083284e6502e5086.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.
Diffstat (limited to 'gc.c')
-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) { |