aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-09 13:56:40 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-09 14:07:38 -0700
commit4190745968d1bf4ee95910ad6815c7e8b3dafc76 (patch)
treeab7dc437b90bd16dfa3d07dc2bf8f33b2526239d
parent3781d44edc506c16c811bf921d61dcc8563e920d (diff)
fix memcpy for ta0 and ta1
-rw-r--r--src/library.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 4f800640..1f7fd37d 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3388,9 +3388,20 @@ LibraryManager.library = {
memcpy__sig: 'iiii',
memcpy__deps: ['emscripten_memcpy_big'],
memcpy: function(dest, src, num) {
+#if USE_TYPED_ARRAYS == 0
+ {{{ makeCopyValues('dest', 'src', 'num', 'null') }}};
+ return num;
+#endif
+#if USE_TYPED_ARRAYS == 1
+ {{{ makeCopyValues('dest', 'src', 'num', 'null') }}};
+ return num;
+#endif
+
dest = dest|0; src = src|0; num = num|0;
var ret = 0;
+#if USE_TYPED_ARRAYS
if ((num|0) >= 4096) return _emscripten_memcpy_big(dest|0, src|0, num|0)|0;
+#endif
ret = dest|0;
if ((dest&3) == (src&3)) {
while (dest & 3) {