aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-25 17:17:23 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-25 17:20:32 -0700
commitf780397c70ca74b233be6898608dd2a6db23bc5e (patch)
tree50311568f9e7c1304529350e4d392f0c279798c6
parentef97794f93db81c3ccf9a60135306742a9aeb424 (diff)
warning and TODO on memory enlarging
-rw-r--r--src/preamble.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 0fbb6fac..b197ef02 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -578,7 +578,7 @@ var STATICTOP;
function enlargeMemory() {
// 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! ' + [STATICTOP, TOTAL_MEMORY]);
+ Module.printErr('Warning: Enlarging memory arrays, this is not fast, and can also break in high optimization levels where we assume globals are not modified! ' + [STATICTOP, TOTAL_MEMORY]); // XXX perhaps never do elimination optimizations of calls that can lead to resizing, to avoid HEAP[malloc()] = X; where JS semantic will write to the old HEAP if malloc replaces it
assert(STATICTOP >= TOTAL_MEMORY);
assert(TOTAL_MEMORY > 4); // So the loop below will not be infinite
#endif