Optimize codegen slightly calling wasm functions
Currently wasm-calls work with `Result<T, Trap>` internally but `Trap` is an enum defined in `wasmtime-runtime` which is actually quite large. Since traps are supposed to be rare this commit changes these functions to return a `Box<Trap>` which is un-boxed later up in the `wasmtime` crate within a `#[cold]` function.
This commit is contained in:
@@ -74,7 +74,7 @@ unsafe extern "system" fn exception_handler(exception_info: PEXCEPTION_POINTERS)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn lazy_per_thread_init() -> Result<(), Trap> {
|
||||
pub fn lazy_per_thread_init() -> Result<(), Box<Trap>> {
|
||||
// Unused on Windows
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user