forked from svaarala/duktape
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'lightweight-functions'
Add support for lightweight functions or "lightfuncs", a plain tagged type that contains a Duktape/C function and 16-bit flags which contain an 8-bit signed magic value, 4-byte argument count (with 15 indicating varargs) and a 4-byte virtual "length" property. A lightfunc requires no heap allocations, so it is useful in low memory environments to reduce RAM footprint. Lightfuncs can be pushed on the value stack using the new API call duk_push_c_lightfunc(). Also add DUK_OPT_LIGHTFUNC_BUILTINS feature option which causes Duktape to convert all built-in functions (like Math.cos) into lightfuncs. This saves around 14 kB of initial RAM usage (which is about 45kB before the change) on 32-bit environments, which is useful for at least devices with 128kB system RAM. Lightfuncs don't interact well with the non-standard "caller" property (DUK_OPT_NONSTD_FUNC_CALLER_PROPERTY) so you shouldn't use them at all if you enable that option. If you don't use lightfuncs or enable DUK_OPT_LIGHTFUNC_BUILTINS, there should be no visible changes, except changes in some error message strings. Internally there are a lot of changes, especially in call handling.
- Loading branch information
Showing
80 changed files
with
6,675 additions
and
755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,5 +34,7 @@ xmldoc | |
FlameGraph | ||
dtrace4linux | ||
flow | ||
massif-*.out | ||
ms_print.* | ||
alljoyn-js | ||
ajtcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.