Skip to content

Commit

Permalink
Rollup merge of rust-lang#49625 - bjorn3:miri_access_memory_kind, r=o…
Browse files Browse the repository at this point in the history
…li-obk

miri: add public alloc_kind accessor
  • Loading branch information
kennytm committed Apr 4, 2018
2 parents 93ad4f2 + ac4f69b commit 391959f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_mir/interpret/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
.ok_or(EvalErrorKind::ExecuteMemory.into())
}

pub fn get_alloc_kind(&self, id: AllocId) -> Option<MemoryKind<M::MemoryKinds>> {
self.alloc_kind.get(&id).cloned()
}

/// For debugging, print an allocation and all allocations it points to, recursively.
pub fn dump_alloc(&self, id: AllocId) {
self.dump_allocs(vec![id]);
Expand Down

0 comments on commit 391959f

Please sign in to comment.