aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-21 18:28:20 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-02-21 18:28:20 -0800
commita23490650c16c4e6b7639920aeeee2ce302a2b61 (patch)
treeb3b97144bd8f80844ffbb28dfaa0714731cb664d /src/library.js
parent85a35ddc2eba7ea69f3fd72cc6a2c8827294b5ed (diff)
parent5cf7c9a2ddf5b6d6895bf975ce174a99330d38d3 (diff)
Merge pull request #860 from waywardmonkeys/strtok-alloc
Statically allocate the strtok state block so it doesn't trip up our leak detection
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js
index 3e84264c..d8f98d73 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4630,10 +4630,8 @@ LibraryManager.library = {
__strtok_state: 0,
strtok__deps: ['__strtok_state', 'strtok_r'],
+ strtok__postset: '___strtok_state = Runtime.staticAlloc(4);',
strtok: function(s, delim) {
- if (!___strtok_state) {
- ___strtok_state = _malloc(4);
- }
return _strtok_r(s, delim, ___strtok_state);
},