summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-29 02:47:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-29 02:47:24 +0000
commit485d04253fcc3320f3f2c1d7eadf7049b84a9d24 (patch)
tree9a69236a727777e6d757648265bd2c5faac3afb2 /vm.c
parent2303483dde5db14a3d8f9dce2f41508e0de62a47 (diff)
vm.c: use MEMCPY
* vm.c (vm_make_env_each): use MEMCPY instead of copy by loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vm.c b/vm.c
index 74fa78b..4b6e0c7 100644
--- a/vm.c
+++ b/vm.c
@@ -512,16 +512,17 @@ vm_make_env_each(const rb_thread_t *const th, rb_control_frame_t *const cfp,
env->env_size = local_size + 1 + 1;
env->local_size = local_size;
- for (i = 0; i <= local_size; i++) {
- env->env[i] = envptr[-local_size + i];
+ i = local_size + 1;
+ MEMCPY(env->env, envptr - local_size, VALUE, i);
#if 0
+ for (i = 0; i <= local_size; i++) {
fprintf(stderr, "%2d ", &envptr[-local_size + i] - th->stack); dp(env->env[i]);
if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
/* clear value stack for GC */
envptr[-local_size + i] = 0;
}
-#endif
}
+#endif
/* be careful not to trigger GC after this */
envval = TypedData_Wrap_Struct(rb_cEnv, &env_data_type, env);