aboutsummaryrefslogtreecommitdiff
path: root/src/settings.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-27 20:07:07 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-27 20:07:07 -0700
commited88bc7051a61e05c6e85e792d56513826722d2e (patch)
treed40113a39ebe21626cb193e1a5652f621052e942 /src/settings.js
parentb1989519a9e66a8c2f5b2174a2eadb53bb8f9f56 (diff)
memory growth must be manually enabled with ALLOW_MEMORY_GROWTH, in which case the eliminator runs in safe mode
Diffstat (limited to 'src/settings.js')
-rw-r--r--src/settings.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/settings.js b/src/settings.js
index a1c41de7..7e7caa6f 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -48,6 +48,13 @@ var TOTAL_MEMORY = 10*1024*1024; // The total amount of memory to use. Using mor
// we need to copy the old heap into a new one in that case.
var FAST_MEMORY = 2*1024*1024; // The amount of memory to initialize to 0. This ensures it will be
// in a flat array. This only matters in non-typed array builds.
+var ALLOW_MEMORY_GROWTH = 0; // If false, we abort with an error if we try to allocate more memory than
+ // we can (TOTAL_MEMORY). If true, we will grow the memory arrays at
+ // runtime, seamlessly and dynamically. This has a performance cost though,
+ // both during the actual growth and in general (the latter is because in
+ // that case we must be careful about optimizations, in particular the
+ // eliminator). Note that memory growth is only supported with typed
+ // arrays.
// Code embetterments
var MICRO_OPTS = 1; // Various micro-optimizations, like nativizing variables