Skip to content

Commit 06c8270

Browse files
committed
apply review
1 parent 4ff9fb8 commit 06c8270

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

crates/vm/src/gc_state.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ bitflags::bitflags! {
2727
}
2828
}
2929

30-
3130
/// Statistics for a single generation (gc_generation_stats)
3231
#[derive(Debug, Default, Clone, Copy)]
3332
pub struct GcStats {
@@ -281,6 +280,16 @@ impl GcState {
281280
tracked.remove(&gc_ptr);
282281
}
283282

283+
// Remove from permanent tracking
284+
if let Ok(mut permanent) = self.permanent_objects.write()
285+
&& permanent.remove(&gc_ptr)
286+
{
287+
let count = self.permanent.count.load(Ordering::SeqCst);
288+
if count > 0 {
289+
self.permanent.count.fetch_sub(1, Ordering::SeqCst);
290+
}
291+
}
292+
284293
// Remove from finalized set
285294
if let Ok(mut finalized) = self.finalized_objects.write() {
286295
finalized.remove(&gc_ptr);

0 commit comments

Comments
 (0)