Add Pages and Bytes newtypes

This commit is contained in:
Lachlan Sneff
2019-01-29 15:44:15 -08:00
parent bc78738bb7
commit 69e9c5154d
16 changed files with 278 additions and 138 deletions

View File

@ -7,6 +7,7 @@ use wasmer_runtime_core::{
prelude::*,
table::Table,
types::{ElementType, MemoryDescriptor, TableDescriptor, Value},
units::Pages,
};
static EXAMPLE_WASM: &'static [u8] = include_bytes!("simple.wasm");
@ -16,8 +17,8 @@ fn main() -> Result<()> {
let inner_module = wasmer_runtime_core::compile_with(&wasm_binary, &CraneliftCompiler::new())?;
let memory = Memory::new(MemoryDescriptor {
min: 1,
max: Some(1),
minimum: Pages(1),
maximum: Some(Pages(1)),
shared: false,
})
.unwrap();
@ -26,8 +27,8 @@ fn main() -> Result<()> {
let table = Table::new(TableDescriptor {
element: ElementType::Anyfunc,
min: 10,
max: None,
minimum: 10,
maximum: None,
})
.unwrap();