diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2018-04-03 17:50:31 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2018-04-04 15:31:49 +0200 |
| commit | ac4f69bea4d41dffe9d56fb4117bd244a6b6acbe (patch) | |
| tree | 4ce5238c3d3df568832e32f658b9104b59653358 | |
| parent | 0bb8935136098dde90d6dcbf24237fd7e2fe569f (diff) | |
| download | rust-ac4f69bea4d41dffe9d56fb4117bd244a6b6acbe.tar.gz rust-ac4f69bea4d41dffe9d56fb4117bd244a6b6acbe.zip | |
miri: add public alloc_kind accessor
| -rw-r--r-- | src/librustc_mir/interpret/memory.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index 3a28eae2d1c..4823f654055 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -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]); |
