diff options
-rwxr-xr-x | emcc | 10 | ||||
-rw-r--r-- | src/compiler.js | 1 |
2 files changed, 10 insertions, 1 deletions
@@ -1105,6 +1105,16 @@ try: shared.Settings.CORRECT_OVERFLOWS = 1 assert not shared.Settings.PGO, 'cannot run PGO in ASM_JS mode' + heap = 4096 + while heap < shared.Settings.TOTAL_MEMORY: + if heap <= 16*1024*1024: + heap *= 2 + else: + heap += 16*1024*1024 + if heap != shared.Settings.TOTAL_MEMORY: + logging.warning('increasing TOTAL_MEMORY to %d to be more reasonable for asm.js' % heap) + shared.Settings.TOTAL_MEMORY = heap + if shared.Settings.CORRECT_SIGNS >= 2 or shared.Settings.CORRECT_OVERFLOWS >= 2 or shared.Settings.CORRECT_ROUNDINGS >= 2: debug_level = 4 # must keep debug info to do line-by-line operations diff --git a/src/compiler.js b/src/compiler.js index 90060837..eadd6a88 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -185,7 +185,6 @@ if (SAFE_HEAP) USE_BSS = 0; // must initialize heap for safe heap assert(!(USE_TYPED_ARRAYS === 2 && QUANTUM_SIZE !== 4), 'For USE_TYPED_ARRAYS == 2, must have normal QUANTUM_SIZE of 4'); 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'); } assert(!(!NAMED_GLOBALS && BUILD_AS_SHARED_LIB), 'shared libraries must have named globals'); |