Commit d9d6b2c7 authored by NARUSE, Yui's avatar NARUSE, Yui

Add document for array_copy

parent d3418a7a
...@@ -63,6 +63,20 @@ mrb_ary_new(mrb_state *mrb) ...@@ -63,6 +63,20 @@ mrb_ary_new(mrb_state *mrb)
return mrb_ary_new_capa(mrb, 0); 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 static inline void
array_copy(mrb_value *dst, const mrb_value *src, size_t size) array_copy(mrb_value *dst, const mrb_value *src, size_t size)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment