Skip to content

Commit 391959f

Browse files
committed
Rollup merge of rust-lang#49625 - bjorn3:miri_access_memory_kind, r=oli-obk
miri: add public alloc_kind accessor
2 parents 93ad4f2 + ac4f69b commit 391959f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/interpret/memory.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
328328
.ok_or(EvalErrorKind::ExecuteMemory.into())
329329
}
330330

331+
pub fn get_alloc_kind(&self, id: AllocId) -> Option<MemoryKind<M::MemoryKinds>> {
332+
self.alloc_kind.get(&id).cloned()
333+
}
334+
331335
/// For debugging, print an allocation and all allocations it points to, recursively.
332336
pub fn dump_alloc(&self, id: AllocId) {
333337
self.dump_allocs(vec![id]);

0 commit comments

Comments
 (0)