diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 4 | ||||
-rw-r--r-- | src/settings.js | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 86f62c41..91cfbe6a 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -867,8 +867,10 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) { args = args.concat(varargs); var argsText = args.join(', '); + // Inline if either we inline whenever we can (and we can), or if there is no noninlined version var inline = LibraryManager.library[shortident + '__inline']; - if (inline) { + var nonInlined = shortident in LibraryManager.library; + if (inline && (INLINE_LIBRARY_FUNCS || !nonInlined)) { return inline.apply(null, args); // Warning: inlining does not prevent recalculation of the arguments. They should be simple identifiers } diff --git a/src/settings.js b/src/settings.js index 0cbe989b..70888a6c 100644 --- a/src/settings.js +++ b/src/settings.js @@ -53,6 +53,7 @@ SKIP_STACK_IN_SMALL = 1; // When enabled, does not push/pop the stack at all in // may allocate stack later, and in a loop, this can be // very bad. In particular, when debugging, printf()ing // a lot can exhaust the stack very fast, with this option. +INLINE_LIBRARY_FUNCS = 1; // Will inline library functions that have __inline defined // Generated code debugging options SAFE_HEAP = 0; // Check each write to the heap against a list of blocked addresses |