diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-08 17:15:37 -0400 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-08 17:27:55 -0400 |
commit | b5f705842e51df9ae25be76feaf1495de8e4252c (patch) | |
tree | a86cc2da6aaf3af55fce7c3ae0bef182dff4c94d /emcc | |
parent | 706907a119b8b74b04daadcd77a741b0bdc74b2c (diff) |
automatically adjust asm heap size
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 10 |
1 files changed, 10 insertions, 0 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 |