mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-25 02:12:13 +00:00
Merge #1289
1289: Enable `DynamicFunc` for closures with captured environment. r=syrusakbary a=losfair Previously we disabled `DynamicFunc` for any non-zero-sized closures to leave space for future changes. However this feature is critical for applications that needs to bring context with host functions, like integrations with dynamic lauguages. So it might be good to enable it. A question left is: should we put this behind a feature flag or enable it by default? @Hywan @syrusakbary Co-authored-by: losfair <zhy20000919@hotmail.com>
This commit is contained in:
commit
7b97b8abb7
@ -59,3 +59,5 @@ generate-debug-information = ["wasm-debug"]
|
||||
# don't export symbols related to the GDB JIT interafce, LLVM or some other native
|
||||
# code will be providing them
|
||||
generate-debug-information-no-export-symbols = []
|
||||
# enable DynamicFunc's for closures with captured environment.
|
||||
dynamicfunc-fat-closures = []
|
||||
|
@ -349,9 +349,8 @@ impl<'a> DynamicFunc<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
// Disable "fat" closures for possible future changes.
|
||||
if mem::size_of::<F>() != 0 {
|
||||
unimplemented!("DynamicFunc with captured environment is not yet supported");
|
||||
if cfg!(not(feature = "dynamicfunc-fat-closures")) && mem::size_of::<F>() != 0 {
|
||||
unimplemented!("DynamicFunc with captured environment is disabled");
|
||||
}
|
||||
|
||||
let mut builder = TrampolineBufferBuilder::new();
|
||||
|
Loading…
x
Reference in New Issue
Block a user