aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-23 17:00:10 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-23 17:00:10 -0800
commit7307d02a3b8b6ca382432a2c47287fa49c728b61 (patch)
treecbc6dadbe93508c6f3c6ed9aab920866529ac59b
parentf23a99a624e51acacb7d38f0e70b2bb12aaf5e73 (diff)
better memory limit message in asm
-rw-r--r--src/preamble.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 7d600348..52e6a7ca 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -598,8 +598,12 @@ var STATICTOP;
#if USE_TYPED_ARRAYS
function enlargeMemory() {
#if ALLOW_MEMORY_GROWTH == 0
+#if ASM_JS == 0
abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');
#else
+ abort('Cannot enlarge memory arrays in asm.js. Compile with -s TOTAL_MEMORY=X with X higher than the current value.');
+#endif
+#else
// TOTAL_MEMORY is the current size of the actual array, and STATICTOP is the new top.
#if ASSERTIONS
Module.printErr('Warning: Enlarging memory arrays, this is not fast, and ALLOW_MEMORY_GROWTH is not fully tested with all optimizations on! ' + [STATICTOP, TOTAL_MEMORY]); // We perform safe elimination instead of elimination in this mode, but if you see this error, try to disable it and other optimizations entirely