Skip to content

Commit

Permalink
Remove unused JS globals for stdin/stdout/stderr (#8410)
Browse files Browse the repository at this point in the history
These globals are defined in musl C code so as far as I can tell
are never used.
  • Loading branch information
sbc100 authored Apr 9, 2019
1 parent 4148129 commit 4ce1300
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,9 @@
LibraryManager.library = {
// keep this low in memory, because we flatten arrays with them in them
#if USE_PTHREADS
stdin: '; if (ENVIRONMENT_IS_PTHREAD) _stdin = PthreadWorkerInit._stdin; else PthreadWorkerInit._stdin = _stdin = {{{ makeStaticAlloc(4) }}}',
stdout: '; if (ENVIRONMENT_IS_PTHREAD) _stdout = PthreadWorkerInit._stdout; else PthreadWorkerInit._stdout = _stdout = {{{ makeStaticAlloc(4) }}}',
stderr: '; if (ENVIRONMENT_IS_PTHREAD) _stderr = PthreadWorkerInit._stderr; else PthreadWorkerInit._stderr = _stderr = {{{ makeStaticAlloc(4) }}}',
_impure_ptr: '; if (ENVIRONMENT_IS_PTHREAD) __impure_ptr = PthreadWorkerInit.__impure_ptr; else PthreadWorkerInit.__impure_ptr __impure_ptr = {{{ makeStaticAlloc(4) }}}',
__dso_handle: '; if (ENVIRONMENT_IS_PTHREAD) ___dso_handle = PthreadWorkerInit.___dso_handle; else PthreadWorkerInit.___dso_handle = ___dso_handle = {{{ makeStaticAlloc(4) }}}',
#else
stdin: '{{{ makeStaticAlloc(1) }}}',
stdout: '{{{ makeStaticAlloc(1) }}}',
stderr: '{{{ makeStaticAlloc(1) }}}',
_impure_ptr: '{{{ makeStaticAlloc(1) }}}',
__dso_handle: '{{{ makeStaticAlloc(1) }}}',
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/library_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mergeInto(LibraryManager.library, {
#if ASSERTIONS
'$ERRNO_MESSAGES', '$ERRNO_CODES',
#endif
'stdin', 'stdout', 'stderr'],
],
$FS__postset: function() {
// TODO: do we need noFSInit?
addAtInit('if (!Module["noFSInit"] && !FS.init.initialized) FS.init();');
Expand Down
2 changes: 1 addition & 1 deletion tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -8252,7 +8252,7 @@ def test_clear_error_on_massive_static_data(self):
if self.is_wasm_backend():
self.assertContained('wasm-ld: error: initial memory too small', err)
else:
self.assertContained('Memory is not large enough for static data (134032) plus the stack (1024), please increase TOTAL_MEMORY (65536)', err)
self.assertContained('Memory is not large enough for static data (133984) plus the stack (1024), please increase TOTAL_MEMORY (65536)', err)

def test_o_level_clamp(self):
for level in [3, 4, 20]:
Expand Down

0 comments on commit 4ce1300

Please sign in to comment.