Reduce max call stack size for debug.

This commit is contained in:
Stephen Chung
2020-10-08 23:00:01 +08:00
parent 1272eeb81a
commit d511aac7a4
5 changed files with 8 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ Maximum Call Stack Depth
Limit How Stack Usage by Scripts
-------------------------------
Rhai by default limits function calls to a maximum depth of 128 levels (16 levels in debug build).
Rhai by default limits function calls to a maximum depth of 128 levels (12 levels in debug build).
This limit may be changed via the `Engine::set_max_call_levels` method.
@@ -17,9 +17,9 @@ This check can be disabled via the [`unchecked`] feature for higher performance
```rust
let mut engine = Engine::new();
engine.set_max_call_levels(10); // allow only up to 10 levels of function calls
engine.set_max_call_levels(10); // allow only up to 10 levels of function calls
engine.set_max_call_levels(0); // allow no function calls at all (max depth = zero)
engine.set_max_call_levels(0); // allow no function calls at all (max depth = zero)
```