summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-02-26 23:29:45 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-02-26 23:29:45 -0800
commitdfafa59c0a79d77c1d00d5dd2ad29c5ab4c6a006 (patch)
tree52067e8004d664b8f2f5d485dc5b3dbd7305f327 /src
parent664205453c26c938d5b688f4ea634ae4ee89e2cf (diff)
parentd9d6b2c74c6b9a3cce18066e361d00eb30ce53b6 (diff)
downloadmruby-dfafa59c0a79d77c1d00d5dd2ad29c5ab4c6a006.tar.gz
mruby-dfafa59c0a79d77c1d00d5dd2ad29c5ab4c6a006.zip
Merge pull request #901 from nurse/array_copy-doc
Add document for array_copy
Diffstat (limited to 'src')
-rw-r--r--src/array.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/array.c b/src/array.c
index 29e43b34f..88c15eb2c 100644
--- a/src/array.c
+++ b/src/array.c
@@ -63,6 +63,20 @@ mrb_ary_new(mrb_state *mrb)
return mrb_ary_new_capa(mrb, 0);
}
+/*
+ * to copy array, use this instead of memcpy because of portability
+ * * gcc on ARM may fail optimization of memcpy
+ * http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka3934.html
+ * * gcc on MIPS also fail
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39755
+ * * memcpy doesn't exist on freestanding environment
+ *
+ * If you optimize for binary size, use memcpy instead of this at your own risk
+ * of above portability issue.
+ *
+ * see also http://togetter.com/li/462898
+ *
+ */
static inline void
array_copy(mrb_value *dst, const mrb_value *src, size_t size)
{