aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-06 13:27:43 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-06 13:27:43 -0800
commitbea3d23dc5316222d31127299ea1896223075ac4 (patch)
treef7eaa5442d162cd3ca2575e6a46c06a0fd7a309c /src/runtime.js
parent0f3f5cc6934a45c78ce7bfb2bdab15bb8756edf7 (diff)
initial work on memory growth
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime.js b/src/runtime.js
index a6261c74..e0eb7404 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -56,7 +56,11 @@ var RuntimeGenerator = {
// An allocation that cannot be free'd
staticAlloc: function(size) {
- return RuntimeGenerator.alloc(size, 'STATIC', INIT_HEAP);
+ var ret = '';
+ if (USE_TYPED_ARRAYS) ret += 'LAST_STATICTOP = STATICTOP;'
+ ret += RuntimeGenerator.alloc(size, 'STATIC', INIT_HEAP);
+ if (USE_TYPED_ARRAYS) ret += 'if (STATICTOP >= TOTAL_MEMORY) enlargeMemory();'
+ return ret;
},
alignMemory: function(target, quantum) {