Struct wiggle::wasmtime_crate::ModuleLimits [−][src]
pub struct ModuleLimits {
pub imported_functions: u32,
pub imported_tables: u32,
pub imported_memories: u32,
pub imported_globals: u32,
pub types: u32,
pub functions: u32,
pub tables: u32,
pub memories: u32,
pub globals: u32,
pub table_elements: u32,
pub memory_pages: u64,
}
Expand description
Represents the limits placed on a module for compiling with the pooling instance allocation strategy.
Fields
imported_functions: u32
The maximum number of imported functions for a module (default is 1000).
This value controls the capacity of the VMFunctionImport
table and the
VMCallerCheckedAnyfunc
table in each instance’s VMContext
structure.
The allocated size of the VMFunctionImport
table will be imported_functions * sizeof(VMFunctionImport)
for each instance regardless of how many functions an instance imports.
The allocated size of the VMCallerCheckedAnyfunc
table will be
imported_functions * functions * sizeof(VMCallerCheckedAnyfunc)
for each instance regardless of
how many functions are imported and defined by an instance.
imported_tables: u32
The maximum number of imported tables for a module (default is 0).
This value controls the capacity of the VMTableImport
table in each instance’s
VMContext
structure.
The allocated size of the table will be imported_tables * sizeof(VMTableImport)
for each
instance regardless of how many tables an instance imports.
imported_memories: u32
The maximum number of imported linear memories for a module (default is 0).
This value controls the capacity of the VMMemoryImport
table in each instance’s
VMContext
structure.
The allocated size of the table will be imported_memories * sizeof(VMMemoryImport)
for each
instance regardless of how many memories an instance imports.
imported_globals: u32
The maximum number of imported globals for a module (default is 0).
This value controls the capacity of the VMGlobalImport
table in each instance’s
VMContext
structure.
The allocated size of the table will be imported_globals * sizeof(VMGlobalImport)
for each
instance regardless of how many globals an instance imports.
types: u32
The maximum number of defined types for a module (default is 100).
This value controls the capacity of the VMSharedSignatureIndex
table in each instance’s
VMContext
structure.
The allocated size of the table will be types * sizeof(VMSharedSignatureIndex)
for each
instance regardless of how many types are defined by an instance’s module.
functions: u32
The maximum number of defined functions for a module (default is 10000).
This value controls the capacity of the VMCallerCheckedAnyfunc
table in each instance’s
VMContext
structure.
The allocated size of the VMCallerCheckedAnyfunc
table will be
imported_functions * functions * sizeof(VMCallerCheckedAnyfunc)
for each instance
regardless of how many functions are imported and defined by an instance.
tables: u32
The maximum number of defined tables for a module (default is 1).
This value controls the capacity of the VMTableDefinition
table in each instance’s
VMContext
structure.
The allocated size of the table will be tables * sizeof(VMTableDefinition)
for each
instance regardless of how many tables are defined by an instance’s module.
memories: u32
The maximum number of defined linear memories for a module (default is 1).
This value controls the capacity of the VMMemoryDefinition
table in each instance’s
VMContext
structure.
The allocated size of the table will be memories * sizeof(VMMemoryDefinition)
for each
instance regardless of how many memories are defined by an instance’s module.
globals: u32
The maximum number of defined globals for a module (default is 10).
This value controls the capacity of the VMGlobalDefinition
table in each instance’s
VMContext
structure.
The allocated size of the table will be globals * sizeof(VMGlobalDefinition)
for each
instance regardless of how many globals are defined by an instance’s module.
table_elements: u32
The maximum table elements for any table defined in a module (default is 10000).
If a table’s minimum element limit is greater than this value, the module will fail to compile.
If a table’s maximum element limit is unbounded or greater than this value,
the maximum will be table_elements
for the purpose of any table.grow
instruction.
This value is used to reserve the maximum space for each supported table; table elements
are pointer-sized in the Wasmtime runtime. Therefore, the space reserved for each instance
is tables * table_elements * sizeof::<*const ()>
.
memory_pages: u64
The maximum number of pages for any linear memory defined in a module (default is 160).
The default of 160 means at most 10 MiB of host memory may be committed for each instance.
If a memory’s minimum page limit is greater than this value, the module will fail to compile.
If a memory’s maximum page limit is unbounded or greater than this value,
the maximum will be memory_pages
for the purpose of any memory.grow
instruction.
This value is used to control the maximum accessible space for each linear memory of an instance.
The reservation size of each linear memory is controlled by the
static_memory_maximum_size
setting and this value cannot
exceed the configured static memory maximum size.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ModuleLimits
impl Send for ModuleLimits
impl Sync for ModuleLimits
impl Unpin for ModuleLimits
impl UnwindSafe for ModuleLimits
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more