Trait miri::shims::alloc::EvalContextExt

source ·
pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
    // Provided methods
    fn min_align(&self, size: u64, kind: MiriMemoryKind) -> Align { ... }
    fn emulate_allocator(
        &mut self,
        default: impl FnOnce(&mut MiriInterpCx<'mir, 'tcx>) -> InterpResult<'tcx>
    ) -> InterpResult<'tcx, EmulateForeignItemResult> { ... }
    fn malloc(
        &mut self,
        size: u64,
        zero_init: bool,
        kind: MiriMemoryKind
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> { ... }
    fn free(
        &mut self,
        ptr: Pointer<Option<Provenance>>,
        kind: MiriMemoryKind
    ) -> InterpResult<'tcx> { ... }
    fn realloc(
        &mut self,
        old_ptr: Pointer<Option<Provenance>>,
        new_size: u64,
        kind: MiriMemoryKind
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> { ... }
}

Provided Methods§

source

fn min_align(&self, size: u64, kind: MiriMemoryKind) -> Align

Returns the minimum alignment for the target architecture for allocations of the given size.

source

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

Emulates calling the internal _rust* allocator functions

source

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

source

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

source

fn realloc( &mut self, old_ptr: Pointer<Option<Provenance>>, new_size: u64, kind: MiriMemoryKind ) -> 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>