Skip to content

Commit

Permalink
Don't move objs in possible cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
frengor authored Aug 3, 2024
1 parent 27a22cf commit f6bc111
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/cc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ pub(crate) fn add_to_list(ptr: NonNull<CcBox<()>>) {

debug_assert!(counter_marker.is_not_marked());

counter_marker.mark(Mark::PossibleCycles);
counter_marker.reset_tracing_counter();
counter_marker.mark(Mark::PossibleCycles);
}

#[cfg(debug_assertions)] // pc.add(...) may panic in debug builds
Expand Down Expand Up @@ -628,14 +629,16 @@ impl CcBox<()> {
}
} else {
if counter_marker.is_in_possible_cycles() {
counter_marker.mark(Mark::NonMarked);
possible_cycles.remove(ptr);
let res = counter_marker.increment_tracing_counter();
debug_assert!(res.is_ok());
return;
}

counter_marker.reset_tracing_counter();
let res = counter_marker.increment_tracing_counter();
counter_marker.reset_tracing_counter();
let res = counter_marker.increment_tracing_counter();
debug_assert!(res.is_ok());



queue.add(ptr);
counter_marker.mark(Mark::InQueue);
}
Expand Down

0 comments on commit f6bc111

Please sign in to comment.