aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler.js5
-rw-r--r--src/settings.js2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler.js b/src/compiler.js
index 05a03ffb..96784cf3 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -172,7 +172,10 @@ RUNTIME_DEBUG = LIBRARY_DEBUG || GL_DEBUG;
// Settings sanity checks
assert(!(USE_TYPED_ARRAYS === 2 && QUANTUM_SIZE !== 4), 'For USE_TYPED_ARRAYS == 2, must have normal QUANTUM_SIZE of 4');
-assert(!(ASM_JS && ALLOW_MEMORY_GROWTH), 'Cannot grow asm.js heap');
+if (ASM_JS) {
+ assert(!ALLOW_MEMORY_GROWTH, 'Cannot grow asm.js heap');
+ assert((TOTAL_MEMORY&(TOTAL_MEMORY-1)) == 0, 'asm.js heap must be power of 2');
+}
// Output some info and warnings based on settings
diff --git a/src/settings.js b/src/settings.js
index 1d115001..b9dfa9e9 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -43,7 +43,7 @@ var TOTAL_STACK = 5*1024*1024; // The total stack size. There is no way to enlar
// value must be large enough for the program's requirements. If
// assertions are on, we will assert on not exceeding this, otherwise,
// it will fail silently.
-var TOTAL_MEMORY = 10*1024*1024; // The total amount of memory to use. Using more memory than this will
+var TOTAL_MEMORY = 16777216; // The total amount of memory to use. Using more memory than this will
// cause us to expand the heap, which can be costly with typed arrays:
// 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