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

@ -1,4 +1,5 @@
use crate::{
error::CreationError,
instance::Function,
sig_registry::SigRegistry,
structures::TypedIndex,
@ -48,7 +49,10 @@ pub struct AnyfuncTable {
}
impl AnyfuncTable {
pub fn new(desc: TableDescriptor, local: &mut vm::LocalTable) -> Result<Box<Self>, ()> {
pub fn new(
desc: TableDescriptor,
local: &mut vm::LocalTable,
) -> Result<Box<Self>, CreationError> {
let initial_table_backing_len = match desc.maximum {
Some(max) => max,
None => desc.minimum,