Trait miri::shims::alloc::EvalContextExt

source ·
pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
    // Provided methods
    fn malloc_align(&self, size: u64) -> Align { ... }
    fn emulate_allocator(
        &mut self,
        default: impl FnOnce(&mut MiriInterpCx<'mir, 'tcx>) -> InterpResult<'tcx>
    ) -> InterpResult<'tcx, EmulateItemResult> { ... }
    fn malloc(
        &mut self,
        size: u64,
        zero_init: bool
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> { ... }
    fn posix_memalign(
        &mut self,
        memptr: &OpTy<'tcx, Provenance>,
        align: &OpTy<'tcx, Provenance>,
        size: &OpTy<'tcx, Provenance>
    ) -> InterpResult<'tcx, Scalar<Provenance>> { ... }
    fn free(&mut self, ptr: Pointer<Option<Provenance>>) -> InterpResult<'tcx> { ... }
    fn realloc(
        &mut self,
        old_ptr: Pointer<Option<Provenance>>,
        new_size: u64
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> { ... }
    fn aligned_alloc(
        &mut self,
        align: &OpTy<'tcx, Provenance>,
        size: &OpTy<'tcx, Provenance>
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> { ... }
}

Provided Methods§

source

fn malloc_align(&self, size: u64) -> Align

Returns the alignment that malloc would guarantee for requests of the given size.

source

fn emulate_allocator( &mut self, default: impl FnOnce(&mut MiriInterpCx<'mir, 'tcx>) -> InterpResult<'tcx> ) -> InterpResult<'tcx, EmulateItemResult>

Emulates calling the internal _rust* allocator functions

source

fn malloc( &mut self, size: u64, zero_init: bool ) -> InterpResult<'tcx, Pointer<Option<Provenance>>>

source

fn posix_memalign( &mut self, memptr: &OpTy<'tcx, Provenance>, align: &OpTy<'tcx, Provenance>, size: &OpTy<'tcx, Provenance> ) -> InterpResult<'tcx, Scalar<Provenance>>

source

fn free(&mut self, ptr: Pointer<Option<Provenance>>) -> InterpResult<'tcx>

source

fn realloc( &mut self, old_ptr: Pointer<Option<Provenance>>, new_size: u64 ) -> InterpResult<'tcx, Pointer<Option<Provenance>>>

source

fn aligned_alloc( &mut self, align: &OpTy<'tcx, Provenance>, size: &OpTy<'tcx, Provenance> ) -> InterpResult<'tcx, Pointer<Option<Provenance>>>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for MiriInterpCx<'mir, 'tcx>