aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-06 18:41:14 -0500
committerAlon Zakai <alonzakai@gmail.com>2014-02-06 18:41:19 -0500
commitd42013b7e6e9be7657936d67dc5aca4a47dc2ee1 (patch)
treede63e3d9031d0252699357509b21cd324952f554
parent42da12d261328082889aea0989ffd1bc76b6c42c (diff)
use .set on big memcpys
-rw-r--r--src/library.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 26ce8457..3a5f6480 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3510,11 +3510,18 @@ LibraryManager.library = {
return ret;
},
+ emscripten_memcpy_big: function(dest, src, num) {
+ HEAPU8.set(HEAPU8.subarray(src, src+num), dest);
+ return dest;
+ },
+
memcpy__asm: true,
memcpy__sig: 'iiii',
+ memcpy__deps: ['emscripten_memcpy_big'],
memcpy: function(dest, src, num) {
dest = dest|0; src = src|0; num = num|0;
var ret = 0;
+ if ((num|0) >= 4096) return _emscripten_memcpy_big(dest|0, src|0, num|0)|0;
ret = dest|0;
if ((dest&3) == (src&3)) {
while (dest & 3) {