More review fixes

This commit is contained in:
Lachlan Sneff
2019-01-29 13:04:42 -08:00
parent 767fdbd950
commit 581363119b
15 changed files with 76 additions and 80 deletions

View File

@ -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)

View File

@ -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
}

View File

@ -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 = {