aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-11-02 01:12:26 +0200
committerJukka Jylänki <jujjyl@gmail.com>2013-11-02 01:46:31 +0200
commitcb3fe2bb6f6d348d3da7ea8c71af909748ff8d71 (patch)
tree93db047235ba65e3aa82c726abf7ec650fb10b71 /emcc
parent97f20af483140174e96385f142df43d7251cfccb (diff)
Add command line parameter --no-heap-copy that optimizes for small memory footprint and fread() performance over the default behavior that copied VFS to HEAP, that is designed for mmap() performance.
Adjust MEMFS node contentMode enum to reflect whether content is off the main HEAP or not. Note that this enum is not much used, so this has little effect. Add browser tests to check that fread() and mmap() work with and without --no-heap-copy.
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc6
1 files changed, 6 insertions, 0 deletions
diff --git a/emcc b/emcc
index 3406ff83..8f8ad4aa 100755
--- a/emcc
+++ b/emcc
@@ -777,6 +777,7 @@ try:
save_bc = False
memory_init_file = False
use_preload_cache = False
+ no_heap_copy = False
proxy_to_worker = False
if use_cxx:
@@ -897,6 +898,9 @@ try:
elif newargs[i].startswith('--use-preload-cache'):
use_preload_cache = True
newargs[i] = ''
+ elif newargs[i].startswith('--no-heap-copy'):
+ no_heap_copy = True
+ newargs[i] = ''
elif newargs[i] == '--ignore-dynamic-linking':
ignore_dynamic_linking = True
newargs[i] = ''
@@ -1667,6 +1671,8 @@ try:
file_args += ['--compress', Compression.encoder, Compression.decoder, Compression.js_name]
if use_preload_cache:
file_args.append('--use-preload-cache')
+ if no_heap_copy:
+ file_args.append('--no-heap-copy')
file_code = execute([shared.PYTHON, shared.FILE_PACKAGER, unsuffixed(target) + '.data'] + file_args, stdout=PIPE)[0]
pre_js = file_code + pre_js