Skip to content

Commit a47dc42

Browse files
committed
fix bug that was clearing chunks for non-permanent frees, we get a perf improvement from the fix too
1 parent 8b555b7 commit a47dc42

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/iso_alloc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,15 +1444,15 @@ INTERNAL_HIDDEN FLATTEN void iso_free_chunk_from_zone(iso_alloc_zone *zone, void
14441444
UNSET_BIT(b, which_bit);
14451445
insert_free_bit_slot(zone, bit_slot);
14461446
zone->is_full = false;
1447+
#if !ENABLE_ASAN && SANITIZE_CHUNKS
1448+
iso_clear_user_chunk(p, zone->chunk_size);
1449+
#endif
1450+
} else {
14471451
iso_clear_user_chunk(p, zone->chunk_size);
14481452
}
14491453

14501454
bm[dwords_to_bit_slot] = b;
14511455

1452-
#if !ENABLE_ASAN && SANITIZE_CHUNKS
1453-
iso_clear_user_chunk(p, zone->chunk_size);
1454-
#endif
1455-
14561456
/* Now that we have free'd this chunk lets validate the
14571457
* chunks before and after it. If they were previously
14581458
* used and currently free they should have canaries

0 commit comments

Comments
 (0)