aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/preamble.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 0bfeda1b..8bde7284 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -566,6 +566,7 @@ function enlargeMemory() {
while (TOTAL_MEMORY <= STATICTOP) { // Simple heuristic. Override enlargeMemory() if your program has something more optimal for it
TOTAL_MEMORY = alignMemoryPage(2*TOTAL_MEMORY);
}
+ assert(TOTAL_MEMORY <= Math.pow(2, 30)); // 2^30==1GB is a practical maximum - 2^31 is already close to possible negative numbers etc.
#if USE_TYPED_ARRAYS == 1
var oldIHEAP = IHEAP;
Module['HEAP'] = Module['IHEAP'] = HEAP = IHEAP = new Int32Array(TOTAL_MEMORY);