1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

Fix a case where we might miss some sweeping

Unlike next_hole, next_hole_in_block doesn't finish_hole, so it doesn't
clear metadata bits.  Fix to always finish_hole when
finish_sweeping_in_block.
This commit is contained in:
Andy Wingo 2023-11-10 15:07:45 +01:00
parent 40be1a03cb
commit adaffab3da

View file

@ -2185,15 +2185,13 @@ static size_t next_hole(struct gc_mutator *mut) {
} }
static void finish_sweeping_in_block(struct gc_mutator *mut) { static void finish_sweeping_in_block(struct gc_mutator *mut) {
while (next_hole_in_block(mut)) do { finish_hole(mut); } while (next_hole_in_block(mut));
finish_hole(mut);
} }
// Another thread is triggering GC. Before we stop, finish clearing the // Another thread is triggering GC. Before we stop, finish clearing the
// dead mark bytes for the mutator's block, and release the block. // dead mark bytes for the mutator's block, and release the block.
static void finish_sweeping(struct gc_mutator *mut) { static void finish_sweeping(struct gc_mutator *mut) {
while (next_hole(mut)) while (next_hole(mut)) {}
finish_hole(mut);
} }
static void trigger_collection(struct gc_mutator *mut, static void trigger_collection(struct gc_mutator *mut,