Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mruby_mbed_web mirb_mbed
Diff: src/value_array.h
- Revision:
- 0:158c61bb030f
diff -r 000000000000 -r 158c61bb030f src/value_array.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/value_array.h	Wed Mar 25 17:36:16 2015 +0000
@@ -0,0 +1,28 @@
+#ifndef MRB_VALUE_ARRAY_H__
+#define MRB_VALUE_ARRAY_H__
+
+#include "mruby.h"
+
+static inline void
+value_move(mrb_value *s1, const mrb_value *s2, size_t n)
+{
+  if (s1 > s2 && s1 < s2 + n)
+  {
+    s1 += n;
+    s2 += n;
+    while (n-- > 0) {
+      *--s1 = *--s2;
+    }
+  }
+  else if (s1 != s2) {
+    while (n-- > 0) {
+      *s1++ = *s2++;
+    }
+  }
+  else {
+    /* nothing to do. */
+  }
+}
+
+#endif /* MRB_VALUE_ARRAY_H__ */
+