Allow instance allocators control over module compilation.
This commit introduces two new methods on `InstanceAllocator`: * `validate_module` - this method is used to validate a module after translation but before compilation. It will be used for the upcoming pooling allocator to ensure a module being compiled adheres to the limits of the allocator. * `adjust_tunables` - this method is used to adjust the `Tunables` given the JIT compiler. The pooling allocator will use this to force all memories to be static during compilation.
This commit is contained in:
@@ -27,6 +27,9 @@ pub struct Tunables {
|
||||
/// Whether or not fuel is enabled for generated code, meaning that fuel
|
||||
/// will be consumed every time a wasm instruction is executed.
|
||||
pub consume_fuel: bool,
|
||||
|
||||
/// Whether or not to treat the static memory bound as the maximum for unbounded heaps.
|
||||
pub static_memory_bound_is_maximum: bool,
|
||||
}
|
||||
|
||||
impl Default for Tunables {
|
||||
@@ -62,6 +65,7 @@ impl Default for Tunables {
|
||||
parse_wasm_debuginfo: true,
|
||||
interruptable: false,
|
||||
consume_fuel: false,
|
||||
static_memory_bound_is_maximum: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user