Skip to content

Commit

Permalink
miri: add public alloc_kind accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Apr 4, 2018
1 parent 0bb8935 commit ac4f69b
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 @@ -352,6 +352,10 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, '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 ac4f69b

Please sign in to comment.