mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-29 00:21:34 +00:00
More review fixes
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
memory::{WASM_MAX_PAGES, WASM_PAGE_SIZE},
|
||||
sys,
|
||||
types::MemoryDesc,
|
||||
types::MemoryDescriptor,
|
||||
vm,
|
||||
};
|
||||
|
||||
@ -27,7 +27,7 @@ pub struct DynamicMemory {
|
||||
}
|
||||
|
||||
impl DynamicMemory {
|
||||
pub(super) fn new(desc: MemoryDesc, local: &mut vm::LocalMemory) -> Option<Box<Self>> {
|
||||
pub(super) fn new(desc: MemoryDescriptor, local: &mut vm::LocalMemory) -> Option<Box<Self>> {
|
||||
let memory = {
|
||||
let mut memory =
|
||||
sys::Memory::with_size((desc.min as usize * WASM_PAGE_SIZE) + DYNAMIC_GUARD_SIZE)
|
||||
|
@ -3,7 +3,7 @@ use crate::{
|
||||
import::IsExport,
|
||||
memory::dynamic::DYNAMIC_GUARD_SIZE,
|
||||
memory::static_::{SAFE_STATIC_GUARD_SIZE, SAFE_STATIC_HEAP_SIZE},
|
||||
types::{MemoryDesc, ValueType},
|
||||
types::{MemoryDescriptor, ValueType},
|
||||
vm,
|
||||
};
|
||||
use std::{cell::RefCell, fmt, mem, ptr, rc::Rc, slice};
|
||||
@ -18,12 +18,12 @@ pub const WASM_PAGE_SIZE: usize = 65_536;
|
||||
pub const WASM_MAX_PAGES: usize = 65_536;
|
||||
|
||||
pub struct Memory {
|
||||
desc: MemoryDesc,
|
||||
desc: MemoryDescriptor,
|
||||
storage: Rc<RefCell<(MemoryStorage, Box<vm::LocalMemory>)>>,
|
||||
}
|
||||
|
||||
impl Memory {
|
||||
pub fn new(desc: MemoryDesc) -> Option<Self> {
|
||||
pub fn new(desc: MemoryDescriptor) -> Option<Self> {
|
||||
let mut vm_local_memory = Box::new(vm::LocalMemory {
|
||||
base: ptr::null_mut(),
|
||||
bound: 0,
|
||||
@ -46,7 +46,7 @@ impl Memory {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn description(&self) -> MemoryDesc {
|
||||
pub fn descriptor(&self) -> MemoryDescriptor {
|
||||
self.desc
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ use crate::{
|
||||
WASM_MAX_PAGES, WASM_PAGE_SIZE,
|
||||
},
|
||||
sys,
|
||||
types::MemoryDesc,
|
||||
types::MemoryDescriptor,
|
||||
vm,
|
||||
};
|
||||
|
||||
@ -27,7 +27,7 @@ pub struct StaticMemory {
|
||||
|
||||
impl StaticMemory {
|
||||
pub(in crate::memory) fn new(
|
||||
desc: MemoryDesc,
|
||||
desc: MemoryDescriptor,
|
||||
local: &mut vm::LocalMemory,
|
||||
) -> Option<Box<Self>> {
|
||||
let memory = {
|
||||
|
Reference in New Issue
Block a user