string.c: clear env self in symbol proc
* string.c (sym_to_proc), proc.c (rb_block_clear_env_self): clear caller's self which is useless, so that it can get collected. [Fixes GH-592] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
be711df831
commit
2f3b28c682
@ -1,3 +1,9 @@
|
|||||||
|
Sat Apr 12 22:11:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (sym_to_proc), proc.c (rb_block_clear_env_self): clear
|
||||||
|
caller's self which is useless, so that it can get collected.
|
||||||
|
[Fixes GH-592]
|
||||||
|
|
||||||
Sat Apr 12 09:26:48 2014 Eric Hodel <drbrain@segment7.net>
|
Sat Apr 12 09:26:48 2014 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* ext/openssl/ossl_ocsp.c: [DOC] Document OpenSSL::OCSP.
|
* ext/openssl/ossl_ocsp.c: [DOC] Document OpenSSL::OCSP.
|
||||||
|
@ -758,6 +758,7 @@ ID rb_id_attrget(ID id);
|
|||||||
VALUE rb_proc_location(VALUE self);
|
VALUE rb_proc_location(VALUE self);
|
||||||
st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
|
st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
|
||||||
int rb_block_arity(void);
|
int rb_block_arity(void);
|
||||||
|
VALUE rb_block_clear_env_self(VALUE proc);
|
||||||
|
|
||||||
/* process.c */
|
/* process.c */
|
||||||
#define RB_MAX_GROUPS (65536)
|
#define RB_MAX_GROUPS (65536)
|
||||||
|
11
proc.c
11
proc.c
@ -709,6 +709,17 @@ rb_block_lambda(void)
|
|||||||
return proc_new(rb_cProc, TRUE);
|
return proc_new(rb_cProc, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_block_clear_env_self(VALUE proc)
|
||||||
|
{
|
||||||
|
rb_proc_t *po;
|
||||||
|
rb_env_t *env;
|
||||||
|
GetProcPtr(proc, po);
|
||||||
|
GetEnvPtr(po->envval, env);
|
||||||
|
env->env[0] = Qnil;
|
||||||
|
return proc;
|
||||||
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_f_lambda(void)
|
rb_f_lambda(void)
|
||||||
{
|
{
|
||||||
|
1
string.c
1
string.c
@ -8506,6 +8506,7 @@ sym_to_proc(VALUE sym)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
proc = rb_proc_new(sym_call, (VALUE)id);
|
proc = rb_proc_new(sym_call, (VALUE)id);
|
||||||
|
rb_block_clear_env_self(proc);
|
||||||
aryp[index] = sym;
|
aryp[index] = sym;
|
||||||
aryp[index + 1] = proc;
|
aryp[index + 1] = proc;
|
||||||
return proc;
|
return proc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user