File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
compiler/rustc_middle/src/mir/interpret Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,13 @@ impl<'tcx> TyCtxt<'tcx> {
525
525
self . alloc_map . lock ( ) . reserve ( )
526
526
}
527
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
+
528
535
/// Reserves a new ID *if* this allocation has not been dedup-reserved before.
529
536
/// Should only be used for "symbolic" allocations (function pointers, vtables, statics), we
530
537
/// don't want to dedup IDs for "real" memory!
You can’t perform that action at this time.
0 commit comments