Skip to content

Commit

Permalink
Go through remove_unreachable_allocs
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Nov 13, 2023
1 parent d366fdd commit fb2f7e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/borrow_tracker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ impl GlobalStateInner {
tag
})
}

pub fn remove_unreachable_allocs(&mut self, reachable: &FxHashSet<AllocId>) {
self.base_ptr_tags.retain(|id, _| reachable.contains(id));
}
}

/// Which borrow tracking method to use
Expand Down
2 changes: 1 addition & 1 deletion src/provenance_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit fb2f7e0

Please sign in to comment.