summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-14 16:23:17 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-14 16:23:17 +0000
commita82ce7c55626086ad264a0d26de63b7603956de9 (patch)
treeff3adfddbfac7be95ed9e90d0cc029d13f4eb175 /proc.c
parent50ae75064639807c8620f3afebc7cc32274b1f4c (diff)
* vm.c: refactoring Proc/Env related code.
* vm_core.h: remove blockprocval field from rb_proc_t and rb_binding_t. Instead of this field, mark given block in Proc at rb_env_t::env. * vm.c (vm_make_env_each): make an Env object with this layout. And also simplify parameters. * proc.c: catch up this fix. * vm_core.h: remove rb_env_t::local_size because it is not used. * vm_dump.c (rb_vmdebug_env_dump_raw): catch up this fix. * vm_core.h (rb_vm_make_env_object): remove rb_vm_make_env_object() because it is only refered from vm.c. * vm_eval.c (eval_string_with_cref): catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/proc.c b/proc.c
index 6c17f27..a95cd2a 100644
--- a/proc.c
+++ b/proc.c
@@ -48,7 +48,6 @@ proc_mark(void *ptr)
rb_proc_t *proc = ptr;
RUBY_MARK_ENTER("proc");
RUBY_MARK_UNLESS_NULL(proc->envval);
- RUBY_MARK_UNLESS_NULL(proc->blockprocval);
RUBY_MARK_UNLESS_NULL(proc->block.proc);
RUBY_MARK_UNLESS_NULL(proc->block.self);
if (proc->block.iseq && RUBY_VM_IFUNC_P(proc->block.iseq)) {
@@ -251,7 +250,6 @@ binding_mark(void *ptr)
bind = ptr;
RUBY_MARK_UNLESS_NULL(bind->env);
RUBY_MARK_UNLESS_NULL(bind->path);
- RUBY_MARK_UNLESS_NULL(bind->blockprocval);
}
RUBY_MARK_LEAVE("binding");
}
@@ -291,7 +289,6 @@ binding_dup(VALUE self)
GetBindingPtr(bindval, dst);
dst->env = src->env;
dst->path = src->path;
- dst->blockprocval = src->blockprocval;
dst->first_lineno = src->first_lineno;
return bindval;
}
@@ -2500,7 +2497,7 @@ env_clone(VALUE envval, VALUE receiver, const rb_cref_t *cref)
}
GetEnvPtr(envval, env);
- envsize = sizeof(rb_env_t) + (env->local_size + 1) * sizeof(VALUE);
+ envsize = sizeof(rb_env_t) + (env->env_size - 1) * sizeof(VALUE);
newenv = xmalloc(envsize);
memcpy(newenv, env, envsize);
RTYPEDDATA_DATA(newenvval) = newenv;
@@ -2548,7 +2545,6 @@ proc_binding(VALUE self)
bindval = rb_binding_alloc(rb_cBinding);
GetBindingPtr(bindval, bind);
bind->env = envval;
- bind->blockprocval = proc->blockprocval;
if (!RUBY_VM_NORMAL_ISEQ_P(iseq)) {
if (RUBY_VM_IFUNC_P(iseq) && IS_METHOD_PROC_ISEQ(iseq)) {