You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -970,7 +971,9 @@ Using include directives is a compile-time preprocessor operation, and is platfo
970
971
971
972
See [Windows Example](http://github.com/atebitftw/ochescript/blob/main/lib/windows_preprocessor.dart).
972
973
973
-
## Stack Size Limits
974
+
## Runtime Stack Size Limits
975
+
[Back To Table Of Contents](#table-of-contents)
976
+
974
977
Since the scope of this language is to live embedded inside other Dart applications, the virtual machine stack is fixed to a size of 8192 elements. This is to prevent memory exhaustion in the host Dart environment. If the stack overflows, the virtual machine will throw a runtime error.
975
978
976
979
Most scripts will rarely come close to this limit (most will never exceed 100). However there are some rare scenarios that could cause a stack overflow:
@@ -982,4 +985,4 @@ Most scripts will rarely come close to this limit (most will never exceed 100).
982
985
```js
983
986
var x = [1, 2, 3, ..., 8192]; // are you really declaring 8192 static elements in a list??
984
987
```
985
-
This will cause a stack overflow because the compiler pushes each element of the list onto the stack before actually building the list. Better to define the list dynamically (e.g. `var x = []; for (var i = 0; i < 10000; i++) x.add(i);`) as this only pushes one element onto the stack at a time.
988
+
This will cause a stack overflow because the compiler design pushes each element of the list onto the stack before actually building the list. Better to define the list dynamically (e.g. `var x = []; for (var i = 0; i < 10000; i++) x.add(i);`) as this only pushes one element onto the stack at a time.
0 commit comments