diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-03-23 03:48:11 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-03-23 03:48:11 -0700 |
| commit | 66bd53a4152572b35bdf73e39713718fa1a3fc17 (patch) | |
| tree | 438aec5e0104e0854fe49820ed905c872508c753 /src/vm.c | |
| parent | af2f3dd16f0d322a4d878196c1b8565cc264d625 (diff) | |
| parent | 2a341753f888d411851e4c30ecd0f2245c275633 (diff) | |
| download | mruby-66bd53a4152572b35bdf73e39713718fa1a3fc17.tar.gz mruby-66bd53a4152572b35bdf73e39713718fa1a3fc17.zip | |
Merge pull request #1048 from monaka/pr-make-array.c-and-vm.c-share-value_move
Make array.c and vm.c share value_move().
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 22 |
1 files changed, 1 insertions, 21 deletions
@@ -16,6 +16,7 @@ #include "mruby/class.h" #include "mruby/numeric.h" #include "error.h" +#include "value_array.h" #include <string.h> #include <setjmp.h> @@ -55,27 +56,6 @@ The value below allows about 60000 recursive calls in the simplest case. */ #endif 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. */ - } -} - -static inline void stack_clear(mrb_value *from, size_t count) { const mrb_value mrb_value_zero = { { 0 } }; |
