more inlining
This commit is contained in:
parent
127610b7c4
commit
956a3ef3bb
1 changed files with 8 additions and 6 deletions
|
@ -10,8 +10,8 @@ use rustc::mir;
|
||||||
use rustc::ty::{self, TyCtxt};
|
use rustc::ty::{self, TyCtxt};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
Allocation, AllocId, InterpResult, Scalar, AllocationExtra,
|
Allocation, AllocId, InterpResult, InterpError, Scalar, AllocationExtra,
|
||||||
InterpCx, PlaceTy, OpTy, ImmTy, MemoryKind, Pointer, Memory
|
InterpCx, PlaceTy, OpTy, ImmTy, MemoryKind, Pointer, Memory,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Whether this kind of memory is allowed to leak
|
/// Whether this kind of memory is allowed to leak
|
||||||
|
@ -209,17 +209,19 @@ pub trait Machine<'mir, 'tcx>: Sized {
|
||||||
extra: Self::FrameExtra,
|
extra: Self::FrameExtra,
|
||||||
) -> InterpResult<'tcx>;
|
) -> InterpResult<'tcx>;
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
fn int_to_ptr(
|
fn int_to_ptr(
|
||||||
_mem: &Memory<'mir, 'tcx, Self>,
|
_mem: &Memory<'mir, 'tcx, Self>,
|
||||||
int: u64,
|
int: u64,
|
||||||
) -> InterpResult<'tcx, Pointer<Self::PointerTag>> {
|
) -> InterpResult<'tcx, Pointer<Self::PointerTag>> {
|
||||||
if int == 0 {
|
Err((if int == 0 {
|
||||||
err!(InvalidNullPointerUsage)
|
InterpError::InvalidNullPointerUsage
|
||||||
} else {
|
} else {
|
||||||
err!(ReadBytesAsPointer)
|
InterpError::ReadBytesAsPointer
|
||||||
}
|
}).into())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
fn ptr_to_int(
|
fn ptr_to_int(
|
||||||
_mem: &Memory<'mir, 'tcx, Self>,
|
_mem: &Memory<'mir, 'tcx, Self>,
|
||||||
_ptr: Pointer<Self::PointerTag>,
|
_ptr: Pointer<Self::PointerTag>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue