diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-04 10:51:02 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 14:23:22 -0800 |
commit | 3de48f97e28bddc99335a9e0a4dfd3ab33985968 (patch) | |
tree | b9ada277a4fa48d4193cd051cd412f43f98d9668 | |
parent | d37d8310a2abe486678984cc6e1048f4b1af0ca9 (diff) |
allocate impure_ptr globally
-rw-r--r-- | src/library.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js index c6adfd6f..c79fc356 100644 --- a/src/library.js +++ b/src/library.js @@ -24,7 +24,7 @@ LibraryManager.library = { stdin: 'allocate(1, "i32*", ALLOC_STACK)', stdout: 'allocate(1, "i32*", ALLOC_STACK)', stderr: 'allocate(1, "i32*", ALLOC_STACK)', - _impure_ptr: 0, + _impure_ptr: 'allocate(1, "i32*", ALLOC_STACK)', $FS__deps: ['$ERRNO_CODES', '__setErrNo', 'stdin', 'stdout', 'stderr', '_impure_ptr'], $FS__postset: '__ATINIT__.unshift({ func: function() { if (!Module["noFSInit"] && !FS.init.initialized) FS.init() } });' + @@ -592,9 +592,9 @@ LibraryManager.library = { FS.checkStreams(); assert(FS.streams.length < 1024); // at this early stage, we should not have a large set of file descriptors - just a few #endif - __impure_ptr = allocate([ allocate( + allocate([ allocate( {{{ Runtime.QUANTUM_SIZE === 4 ? '[0, 0, 0, 0, _stdin, 0, 0, 0, _stdout, 0, 0, 0, _stderr, 0, 0, 0]' : '[0, _stdin, _stdout, _stderr]' }}}, - 'void*', ALLOC_STATIC) ], 'void*', ALLOC_STATIC); + 'void*', ALLOC_STATIC) ], 'void*', ALLOC_NONE, __impure_ptr); }, quit: function() { |