From fb2f7e0f550fc5a9fb9cce7b2e43f30fef98bf7c Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Mon, 13 Nov 2023 16:59:59 -0500 Subject: [PATCH] Go through remove_unreachable_allocs --- src/borrow_tracker/mod.rs | 4 ++++ src/provenance_gc.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/borrow_tracker/mod.rs b/src/borrow_tracker/mod.rs index 852da3a68a..2fc7e5a88b 100644 --- a/src/borrow_tracker/mod.rs +++ b/src/borrow_tracker/mod.rs @@ -236,6 +236,10 @@ impl GlobalStateInner { tag }) } + + pub fn remove_unreachable_allocs(&mut self, reachable: &FxHashSet) { + self.base_ptr_tags.retain(|id, _| reachable.contains(id)); + } } /// Which borrow tracking method to use diff --git a/src/provenance_gc.rs b/src/provenance_gc.rs index 8e1775cfb9..cfef34e52a 100644 --- a/src/provenance_gc.rs +++ b/src/provenance_gc.rs @@ -185,7 +185,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> { this.machine.allocation_spans.borrow_mut().retain(|id, _| allocs.contains(id)); this.machine.intptrcast.borrow_mut().remove_unreachable_allocs(&allocs); if let Some(borrow_tracker) = &this.machine.borrow_tracker { - borrow_tracker.borrow_mut().base_ptr_tags.retain(|id, _| allocs.contains(id)); + borrow_tracker.borrow_mut().remove_unreachable_allocs(&allocs); } } }