aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-01-23 19:36:53 -0800
committerBruce Mitchener <bruce.mitchener@gmail.com>2013-02-20 18:22:04 +0700
commit5cf7c9a2ddf5b6d6895bf975ce174a99330d38d3 (patch)
treef254f46f822a65d53286533289b80f14eec7fbb7 /src/library.js
parent29244f1f86a71419919c5d0e850db7672ee38056 (diff)
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 ffac685b..ee0befa1 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4619,10 +4619,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);
},