pub(crate) fn memory_index(&self, memory: &VMMemoryDefinition) -> DefinedMemoryIndex {
        let offsets = &self.offsets;
        let begin = unsafe {
            (&self.vmctx as *const VMContext as *const u8)
                .add(cast::usize(offsets.vmctx_memories_begin()))
        } as *const VMMemoryDefinition;
        let end: *const VMMemoryDefinition = memory;
        // TODO: Use `offset_from` once it stablizes.
        let index = DefinedMemoryIndex::new(
            (end as usize - begin as usize) / mem::size_of::<VMMemoryDefinition>(),
        );
        assert!(index.index() < self.memories.len());
        index
    }
/// Return the memory index for the given `VMMemoryDefinition`.
Return the memory index for the given `VMMemoryDefinition`.
Return the memory index for the given ` VMMemoryDefinition ` .
pub(crate) fn memory_index(&self, memory: &VMMemoryDefinition) -> DefinedMemoryIndex {
        let offsets = &self.offsets;
        let begin = unsafe {
            (&self.vmctx as *const VMContext as *const u8)
                .add(cast::usize(offsets.vmctx_memories_begin()))
        } as *const VMMemoryDefinition;
        let end: *const VMMemoryDefinition = memory;
        // TODO: Use `offset_from` once it stablizes.
        let index = DefinedMemoryIndex::new(
            (end as usize - begin as usize) / mem::size_of::<VMMemoryDefinition>(),
        );
        assert!(index.index() < self.memories.len());
        index
    }
pub ( crate ) fn memory_index ( & self , memory : & VMMemoryDefinition ) -> DefinedMemoryIndex { let offsets = & self . offsets ; let begin = unsafe { ( & self . vmctx as * const VMContext as * const u8 ) . add ( cast :: usize ( offsets . vmctx_memories_begin ( ) ) ) } as * const VMMemoryDefinition ; let end : * const VMMemoryDefinition = memory ; // TODO: Use `offset_from` once it stablizes. let index = DefinedMemoryIndex :: new ( ( end as usize - begin as usize ) / mem :: size_of :: < VMMemoryDefinition > ( ) , ) ; assert ! ( index index ( ) self memories len ( ) ) ; index }
Return the memory index for the given `VMMemoryDefinition`.
Return the memory index for the given ` VMMemoryDefinition ` .
&self
memory
&VMMemoryDefinition