Remove Stacked Borrows GC heuristics
This commit is contained in:
parent
9b8119dc21
commit
8344dae333
@ -37,8 +37,6 @@ pub struct Stacks {
|
|||||||
history: AllocHistory,
|
history: AllocHistory,
|
||||||
/// The set of tags that have been exposed inside this allocation.
|
/// The set of tags that have been exposed inside this allocation.
|
||||||
exposed_tags: FxHashSet<BorTag>,
|
exposed_tags: FxHashSet<BorTag>,
|
||||||
/// Whether this memory has been modified since the last time the tag GC ran
|
|
||||||
modified_since_last_gc: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Indicates which permissions to grant to the retagged pointer.
|
/// Indicates which permissions to grant to the retagged pointer.
|
||||||
@ -450,15 +448,10 @@ impl<'tcx> Stack {
|
|||||||
/// Integration with the BorTag garbage collector
|
/// Integration with the BorTag garbage collector
|
||||||
impl Stacks {
|
impl Stacks {
|
||||||
pub fn remove_unreachable_tags(&mut self, live_tags: &FxHashSet<BorTag>) {
|
pub fn remove_unreachable_tags(&mut self, live_tags: &FxHashSet<BorTag>) {
|
||||||
if self.modified_since_last_gc {
|
for (_stack_range, stack) in self.stacks.iter_mut_all() {
|
||||||
for (_stack_range, stack) in self.stacks.iter_mut_all() {
|
stack.retain(live_tags);
|
||||||
if stack.len() > 64 {
|
|
||||||
stack.retain(live_tags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
self.history.retain(live_tags);
|
|
||||||
self.modified_since_last_gc = false;
|
|
||||||
}
|
}
|
||||||
|
self.history.retain(live_tags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,7 +481,6 @@ impl<'tcx> Stacks {
|
|||||||
stacks: RangeMap::new(size, stack),
|
stacks: RangeMap::new(size, stack),
|
||||||
history: AllocHistory::new(id, item, machine),
|
history: AllocHistory::new(id, item, machine),
|
||||||
exposed_tags: FxHashSet::default(),
|
exposed_tags: FxHashSet::default(),
|
||||||
modified_since_last_gc: false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,7 +495,6 @@ impl<'tcx> Stacks {
|
|||||||
&mut FxHashSet<BorTag>,
|
&mut FxHashSet<BorTag>,
|
||||||
) -> InterpResult<'tcx>,
|
) -> InterpResult<'tcx>,
|
||||||
) -> InterpResult<'tcx> {
|
) -> InterpResult<'tcx> {
|
||||||
self.modified_since_last_gc = true;
|
|
||||||
for (stack_range, stack) in self.stacks.iter_mut(range.start, range.size) {
|
for (stack_range, stack) in self.stacks.iter_mut(range.start, range.size) {
|
||||||
let mut dcx = dcx_builder.build(&mut self.history, Size::from_bytes(stack_range.start));
|
let mut dcx = dcx_builder.build(&mut self.history, Size::from_bytes(stack_range.start));
|
||||||
f(stack, &mut dcx, &mut self.exposed_tags)?;
|
f(stack, &mut dcx, &mut self.exposed_tags)?;
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
//@compile-flags: -Zmiri-permissive-provenance
|
// We disable the GC for this test because it would change what is printed. We are testing the
|
||||||
|
// printing, not how it interacts with the GC.
|
||||||
|
//@compile-flags: -Zmiri-permissive-provenance -Zmiri-provenance-gc=0
|
||||||
|
|
||||||
#![feature(strict_provenance)]
|
#![feature(strict_provenance)]
|
||||||
use std::{
|
use std::{
|
||||||
alloc::{self, Layout},
|
alloc::{self, Layout},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user