diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-24 14:07:29 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-24 14:07:29 -0800 |
commit | 823c8534b9712810bae2bd9bbe1c7f89cd062cc2 (patch) | |
tree | 83d7370c6187963fbfaf9cc7ecba61aa324005b9 /src/preamble.js | |
parent | af99c279356f4703562633214142e4cccd558a2e (diff) |
optimize memset
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js index 52e6a7ca..a677dfaa 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -473,6 +473,14 @@ Module['ALLOC_STACK'] = ALLOC_STACK; Module['ALLOC_STATIC'] = ALLOC_STATIC; Module['ALLOC_NONE'] = ALLOC_NONE; +// Simple unoptimized memset - necessary during startup +var _memset = function(ptr, value, num) { + var stop = ptr + num; + while (ptr < stop) { + {{{ makeSetValueAsm('ptr++', 0, 'value', 'i8') }}}; + } +} + // allocate(): This is for internal use. You can use it yourself as well, but the interface // is a little tricky (see docs right below). The reason is that it is optimized // for multiple syntaxes to save space in generated code. So you should |