Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
juj committed Feb 13, 2021
1 parent 8c0be42 commit 086a18f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,8 @@ def default_setting(name, new_default):

# Default to TEXTDECODER=2 (always use TextDecoder to decode UTF-8 strings)
# in -Oz builds, since custom decoder for UTF-8 takes up space.
# In pthreads enabled builds, TEXTDECODER==2 may not work, see
# https://github.com/whatwg/encoding/issues/172
if shared.Settings.SHRINK_LEVEL >= 2 and not shared.Settings.USE_PTHREADS:
default_setting('TEXTDECODER', 2)

Expand Down Expand Up @@ -1512,7 +1514,7 @@ def default_setting(name, new_default):
exit_with_error('USE_PTHREADS=2 is not longer supported')
if shared.Settings.ALLOW_MEMORY_GROWTH:
diagnostics.warning('pthreads-mem-growth', 'USE_PTHREADS + ALLOW_MEMORY_GROWTH may run non-wasm code slowly, see https://github.com/WebAssembly/design/issues/1271')
# UTF8Decoder.decode doesn't work with a view of a SharedArrayBuffer
# UTF8Decoder.decode may not work with a view of a SharedArrayBuffer, see https://github.com/whatwg/encoding/issues/172
shared.Settings.TEXTDECODER = 0
shared.Settings.SYSTEM_JS_LIBRARIES.append((0, shared.path_from_root('src', 'library_pthread.js')))
newargs += ['-pthread']
Expand Down

0 comments on commit 086a18f

Please sign in to comment.