aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-01 17:57:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-01 17:57:37 +0000
commit1a2b90d5e6c7b6ecd1d4c0ba9445fb730b39776b (patch)
tree973b19a521528d0a87c2c77e7f57cd6707f1cb38 /proc.c
parent0fdb18e513b53e71911c57a7b5fddd86c3a17704 (diff)
downloadruby-1a2b90d5e6c7b6ecd1d4c0ba9445fb730b39776b.tar.gz
vm.c: rb_vm_env_local_variables
* vm.c (rb_vm_env_local_variables): returns array of local variable name symbols in the environment by envval. * proc.c (bind_local_variables): use rb_vm_env_local_variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/proc.c b/proc.c
index f81483c7b1..faede42d49 100644
--- a/proc.c
+++ b/proc.c
@@ -467,36 +467,10 @@ check_local_id(VALUE bindval, volatile VALUE *pname)
static VALUE
bind_local_variables(VALUE bindval)
{
- VALUE ary = rb_ary_new();
-
const rb_binding_t *bind;
- const rb_env_t *env;
- VALUE envval;
GetBindingPtr(bindval, bind);
-
- envval = bind->env;
-
- do {
- const rb_iseq_t *iseq;
- int i;
- ID id;
-
- GetEnvPtr(envval, env);
- iseq = env->block.iseq;
-
- for (i = 0; i < iseq->local_table_size; i++) {
- id = iseq->local_table[i];
- if (id) {
- const char *vname = rb_id2name(id);
- if (vname) {
- rb_ary_push(ary, ID2SYM(id));
- }
- }
- }
- } while ((envval = env->prev_envval) != 0);
-
- return ary;
+ return rb_vm_env_local_variables(bind->env);
}
/*