fmt
This commit is contained in:
parent
eed24ac572
commit
f1b944d1a2
@ -125,7 +125,7 @@ pub use crate::machine::{
|
|||||||
};
|
};
|
||||||
pub use crate::mono_hash_map::MonoHashMap;
|
pub use crate::mono_hash_map::MonoHashMap;
|
||||||
pub use crate::operator::EvalContextExt as _;
|
pub use crate::operator::EvalContextExt as _;
|
||||||
pub use crate::provenance_gc::{EvalContextExt as _, VisitProvenance, VisitWith, LiveAllocs};
|
pub use crate::provenance_gc::{EvalContextExt as _, LiveAllocs, VisitProvenance, VisitWith};
|
||||||
pub use crate::range_map::RangeMap;
|
pub use crate::range_map::RangeMap;
|
||||||
|
|
||||||
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be
|
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be
|
||||||
|
@ -157,15 +157,13 @@ pub struct LiveAllocs<'a, 'mir, 'tcx> {
|
|||||||
|
|
||||||
impl LiveAllocs<'_, '_, '_> {
|
impl LiveAllocs<'_, '_, '_> {
|
||||||
pub fn is_live(&self, id: AllocId) -> bool {
|
pub fn is_live(&self, id: AllocId) -> bool {
|
||||||
self.collected.contains(&id) ||
|
self.collected.contains(&id) || self.ecx.is_alloc_live(id)
|
||||||
self.ecx.is_alloc_live(id)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
|
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
|
||||||
pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
|
pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
|
||||||
fn run_provenance_gc(&mut self) {
|
fn run_provenance_gc(&mut self) {
|
||||||
|
|
||||||
// We collect all tags from various parts of the interpreter, but also
|
// We collect all tags from various parts of the interpreter, but also
|
||||||
let this = self.eval_context_mut();
|
let this = self.eval_context_mut();
|
||||||
|
|
||||||
@ -196,10 +194,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
|
|||||||
|
|
||||||
fn remove_unreachable_allocs(&mut self, allocs: FxHashSet<AllocId>) {
|
fn remove_unreachable_allocs(&mut self, allocs: FxHashSet<AllocId>) {
|
||||||
let this = self.eval_context_ref();
|
let this = self.eval_context_ref();
|
||||||
let allocs = LiveAllocs {
|
let allocs = LiveAllocs { ecx: this, collected: allocs };
|
||||||
ecx: this,
|
|
||||||
collected: allocs,
|
|
||||||
};
|
|
||||||
this.machine.allocation_spans.borrow_mut().retain(|id, _| allocs.is_live(*id));
|
this.machine.allocation_spans.borrow_mut().retain(|id, _| allocs.is_live(*id));
|
||||||
this.machine.intptrcast.borrow_mut().remove_unreachable_allocs(&allocs);
|
this.machine.intptrcast.borrow_mut().remove_unreachable_allocs(&allocs);
|
||||||
if let Some(borrow_tracker) = &this.machine.borrow_tracker {
|
if let Some(borrow_tracker) = &this.machine.borrow_tracker {
|
||||||
|
@ -12,7 +12,5 @@ pub use miri_extern::*;
|
|||||||
|
|
||||||
pub fn run_provenance_gc() {
|
pub fn run_provenance_gc() {
|
||||||
// SAFETY: No preconditions. The GC is fine to run at any time.
|
// SAFETY: No preconditions. The GC is fine to run at any time.
|
||||||
unsafe {
|
unsafe { miri_run_provenance_gc() }
|
||||||
miri_run_provenance_gc()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user