* variable.c (rb_autoloading_value) Fix the order of definitions.
It is used by autoload_defined_p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6240b52cb9
commit
d163179c3e
@ -1,3 +1,8 @@
|
|||||||
|
Thu Sep 1 09:27:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* variable.c (rb_autoloading_value) Fix the order of definitions.
|
||||||
|
It is used by autoload_defined_p.
|
||||||
|
|
||||||
Wed Aug 31 17:28:23 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
|
Wed Aug 31 17:28:23 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
|
||||||
|
|
||||||
* variable.c (rb_autoload): There was a chance to run GC (from
|
* variable.c (rb_autoload): There was a chance to run GC (from
|
||||||
|
24
variable.c
24
variable.c
@ -1601,18 +1601,6 @@ check_autoload_required(VALUE mod, ID id, const char **loadingpath)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
autoload_defined_p(VALUE mod, ID id)
|
|
||||||
{
|
|
||||||
struct st_table *tbl = RCLASS_CONST_TBL(mod);
|
|
||||||
st_data_t val;
|
|
||||||
|
|
||||||
if (!tbl || !st_lookup(tbl, (st_data_t)id, &val) || ((rb_const_entry_t*)val)->value != Qundef) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return !rb_autoloading_value(mod, id, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
rb_autoloading_value(VALUE mod, ID id, VALUE* value)
|
rb_autoloading_value(VALUE mod, ID id, VALUE* value)
|
||||||
{
|
{
|
||||||
@ -1633,6 +1621,18 @@ rb_autoloading_value(VALUE mod, ID id, VALUE* value)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
autoload_defined_p(VALUE mod, ID id)
|
||||||
|
{
|
||||||
|
struct st_table *tbl = RCLASS_CONST_TBL(mod);
|
||||||
|
st_data_t val;
|
||||||
|
|
||||||
|
if (!tbl || !st_lookup(tbl, (st_data_t)id, &val) || ((rb_const_entry_t*)val)->value != Qundef) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return !rb_autoloading_value(mod, id, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
struct autoload_const_set_args {
|
struct autoload_const_set_args {
|
||||||
VALUE mod;
|
VALUE mod;
|
||||||
ID id;
|
ID id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user