We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1be1e84 + d7cecd3 commit 0ea7ddcCopy full SHA for 0ea7ddc
compiler/rustc_middle/src/mir/interpret/mod.rs
@@ -525,6 +525,13 @@ impl<'tcx> TyCtxt<'tcx> {
525
self.alloc_map.lock().reserve()
526
}
527
528
+ /// Miri's provenance GC needs to see all live allocations. The interpreter manages most
529
+ /// allocations but some are managed by [`TyCtxt`] and without this method the interpreter
530
+ /// doesn't know their [`AllocId`]s are in use.
531
+ pub fn iter_allocs<F: FnMut(AllocId)>(self, func: F) {
532
+ self.alloc_map.lock().alloc_map.keys().copied().for_each(func)
533
+ }
534
+
535
/// Reserves a new ID *if* this allocation has not been dedup-reserved before.
536
/// Should only be used for "symbolic" allocations (function pointers, vtables, statics), we
537
/// don't want to dedup IDs for "real" memory!
0 commit comments