diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-04-24 15:20:08 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-04-24 15:20:42 +0200 |
| commit | 3cc0f1ef0dd9d08bf416e1299fb497db3fbc0d2f (patch) | |
| tree | 46b58da72d1078b728dc4a71d818d7d7cbedc6c7 | |
| parent | bc802bd8fb1656e5004b7c1b8a4e02ec7fc31aa8 (diff) | |
Disable stacker on WASM
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/eval/mod.rs | 10 |
2 files changed, 9 insertions, 3 deletions
@@ -53,6 +53,8 @@ usvg = { version = "0.22", default-features = false, features = ["text"] } xmp-writer = "0.1" tracing = "0.1.37" indexmap = "1.9.3" + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] stacker = "0.1.15" [profile.dev] diff --git a/src/eval/mod.rs b/src/eval/mod.rs index 05a43404..850a3d32 100644 --- a/src/eval/mod.rs +++ b/src/eval/mod.rs @@ -1119,10 +1119,14 @@ impl Eval for ast::FuncCall { let callee = callee.cast::<Func>().at(callee_span)?; let point = || Tracepoint::Call(callee.name().map(Into::into)); + let f = || callee.call_vm(vm, args).trace(vm.world(), point, span); - stacker::maybe_grow(32 * 1024, 2 * 1024 * 1024, || { - callee.call_vm(vm, args).trace(vm.world(), point, span) - }) + // Stacker is broken on WASM. + #[cfg(target_arch = "wasm32")] + return f(); + + #[cfg(not(target_arch = "wasm32"))] + stacker::maybe_grow(32 * 1024, 2 * 1024 * 1024, f) } } |
