add a pointer_size method to Memory for easy access
This commit is contained in:
parent
205a988c1b
commit
d13153c424
1 changed files with 5 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ use std::{fmt, iter, mem, ptr};
|
|||
use rustc::hir::def_id::DefId;
|
||||
use rustc::ty::BareFnTy;
|
||||
use rustc::ty::subst::Substs;
|
||||
use rustc::ty::layout::{Size, TargetDataLayout};
|
||||
use rustc::ty::layout::TargetDataLayout;
|
||||
|
||||
use error::{EvalError, EvalResult};
|
||||
use primval::PrimVal;
|
||||
|
|
@ -155,6 +155,10 @@ impl<'a, 'tcx> Memory<'a, 'tcx> {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn pointer_size(&self) -> usize {
|
||||
self.layout.pointer_size.bytes() as usize
|
||||
}
|
||||
}
|
||||
|
||||
/// Allocation accessors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue