21#include "ccan/list/list.h"
29static ID autoload, classpath, tmp_classpath;
30static VALUE autoload_featuremap;
32static void check_before_mod_set(
VALUE,
ID,
VALUE,
const char *);
34static VALUE rb_const_search(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility);
36static st_table *generic_iv_tbl_compat;
105 return classname(
mod, &permanent);
156 VALUE path = rb_tmp_class_path(
klass, &permanent, make_temporary_path);
165 return classname(
klass, &permanent);
178 return rb_tmp_class_path(
klass, &permanent, no_fallback);
192build_const_path(
VALUE head,
ID tail)
194 return build_const_pathname(head,
rb_id2str(tail));
201 ID pathid = classpath;
208 str = rb_tmp_class_path(under, &permanent, make_temporary_path);
211 pathid = tmp_classpath;
238 if (
path == pend ||
path[0] ==
'#') {
243 while (p < pend && *p !=
':') p++;
245 if (p < pend && p[0] ==
':') {
246 if ((
size_t)(pend - p) < 2 || p[1] !=
':')
goto undefined_class;
256 if (c ==
Qundef)
goto undefined_class;
257 if (!rb_namespace_p(c)) {
312rb_find_global_entry(
ID id)
364 var->
data = (
void*)val;
382 var->
data = (
void*)val;
395 if (!var)
return Qnil;
418mark_global_entry(
VALUE v,
void *ignored)
441global_id(
const char *
name)
459find_global_id(
const char *
name)
464 if (
name[0] ==
'$') {
490 gvar->
data = (
void*)var;
543 trace->
func = rb_trace_eval;
560 while (trace->
next) {
607 if (trace->
data == cmd) {
683 ID id = find_global_id(
name);
734 if (!
NIL_P(backref)) {
738 for (
i = 1;
i <= nmatch; ++
i) {
787 entry1->
var = entry2->
var;
805 return generic_iv_tbl;
813 if (gen_ivtbl_get(
obj, &ivtbl)) {
818 if (index < ivtbl->
numiv) {
822 return ret ==
Qundef ? undef : ret;
834 if (gen_ivtbl_get(
obj, &ivtbl)) {
839 if (index < ivtbl->
numiv) {
842 return ret ==
Qundef ? undef : ret;
850gen_ivtbl_bytes(
size_t n)
871gen_ivtbl_dup(
const struct gen_ivtbl *orig)
873 size_t s = gen_ivtbl_bytes(orig->
numiv);
915 newsize = iv_index_tbl_newsize(ivup);
916 ivtbl = gen_ivtbl_resize(ivtbl, newsize);
930 if (!iv_index_tbl)
return Qfalse;
932 if (!gen_ivtbl_get(
obj, &ivtbl))
return Qfalse;
948 if (!iv_index_tbl)
return 0;
950 if (!gen_ivtbl_get(
obj, &ivtbl))
return 0;
952 if (index < ivtbl->
numiv) {
963gen_ivtbl_mark(
const struct gen_ivtbl *ivtbl)
967 for (
i = 0;
i < ivtbl->
numiv;
i++) {
977 if (gen_ivtbl_get(
obj, &ivtbl)) {
978 gen_ivtbl_mark(ivtbl);
1001 if (generic_iv_tbl_compat) {
1014 if (gen_ivtbl_get(
obj, &ivtbl))
1015 return gen_ivtbl_bytes(ivtbl->
numiv);
1020gen_ivtbl_count(
const struct gen_ivtbl *ivtbl)
1025 for (
i = 0;
i < ivtbl->
numiv;
i++) {
1048 if (!iv_index_tbl)
break;
1063 return generic_ivar_get(
obj,
id, undef);
1103 if (!iv_index_tbl)
break;
1119 return generic_ivar_delete(
obj,
id, undef);
1128 return rb_ivar_delete(
obj,
id,
Qnil);
1137 if (!iv_index_tbl) {
1141 return iv_index_tbl;
1165 iv_index_tbl_extend(&ivup,
id);
1175obj_ivar_heap_alloc(
VALUE obj,
size_t newsize)
1179 if (newptr !=
NULL) {
1197 newptr = obj_ivar_heap_alloc(
obj, newsize);
1202 newptr[
i] = orig_ptr[
i];
1213#if USE_TRANSIENT_HEAP
1227 new_ptr = obj_ivar_heap_alloc(
obj,
len);
1243 iv_index_tbl_extend(&ivup,
id);
1256 uint32_t newsize = iv_index_tbl_newsize(&ivup);
1259 newptr = obj_ivar_heap_alloc(
obj, newsize);
1265 newptr = obj_ivar_heap_realloc(
obj,
len, newsize);
1267 for (;
len < newsize;
len++) {
1286 obj_ivar_set(
obj,
id, val);
1294 generic_ivar_set(
obj,
id, val);
1303 ivar_set(
obj,
id, val);
1313 ivar_set(
obj,
id, val);
1327 if (!iv_index_tbl)
break;
1341 return generic_ivar_defined(
obj,
id);
1411 if (!iv_index_tbl)
return;
1412 if (!gen_ivtbl_get(
obj, &data.ivtbl))
return;
1434 iv_index_tbl_extend(&ivup,
id);
1436 uint32_t newsize = iv_index_tbl_newsize(&ivup);
1437 c->
ivtbl = gen_ivtbl_resize(c->
ivtbl, newsize);
1461 if (gen_ivtbl_get(
obj, &ivtbl)) {
1465 if (gen_ivtbl_count(
ivtbl) == 0)
1468 if (gen_ivtbl_get(clone, &c.
ivtbl)) {
1494 obj_ivar_each(
obj, func,
arg);
1504 gen_ivar_each(
obj, func,
arg);
1522 for (
i =
count = 0;
i < num; ++
i) {
1540 if (gen_ivtbl_get(
obj, &ivtbl)) {
1541 return gen_ivtbl_count(ivtbl);
1588#define rb_is_constant_id rb_is_const_id
1589#define rb_is_constant_name rb_is_const_name
1590#define id_for_var(obj, name, part, type) \
1591 id_for_var_message(obj, name, type, "`%1$s' is not allowed as "#part" "#type" variable name")
1592#define id_for_var_message(obj, name, type, message) \
1593 check_id_type(obj, &(name), rb_is_##type##_id, rb_is_##type##_name, message, strlen(message))
1596 int (*valid_id_p)(
ID),
int (*valid_name_p)(
VALUE),
1597 const char *message,
size_t message_len)
1602 if (
id ? !valid_id_p(
id) : !valid_name_p(
name)) {
1650 if (!iv_index_tbl)
break;
1668 if (generic_ivar_remove(
obj,
id, &val)) {
1753autoload_mark(
void *
ptr)
1759autoload_free(
void *
ptr)
1765autoload_memsize(
const void *
ptr)
1772autoload_compact(
void *
ptr)
1779 {autoload_mark, autoload_free, autoload_memsize, autoload_compact,},
1783#define check_autoload_table(av) \
1784 (struct st_table *)rb_check_typeddata((av), &autoload_data_type)
1827autoload_i_compact(
void *
ptr)
1834autoload_i_mark(
void *
ptr)
1847autoload_i_free(
void *
ptr)
1858autoload_i_memsize(
const void *
ptr)
1865 {autoload_i_mark, autoload_i_free, autoload_i_memsize, autoload_i_compact},
1870autoload_c_compact(
void *
ptr)
1881autoload_c_mark(
void *
ptr)
1892autoload_c_free(
void *
ptr)
1900autoload_c_memsize(
const void *
ptr)
1907 {autoload_c_mark, autoload_c_free, autoload_c_memsize, autoload_c_compact,},
1930 if (!file || !*file) {
1974 if (!autoload_featuremap) {
1982 &autoload_data_i_type, ele);
1995 &autoload_const_type, ac);
2017 ele = get_autoload_data((
VALUE)load, &ac);
2038check_autoload_required(
VALUE mod,
ID id,
const char **loadingpath)
2041 VALUE load = autoload_data(
mod,
id);
2043 const char *loading;
2045 if (!load || !(ele = get_autoload_data(load, 0))) {
2068 if (loadingpath && loading) {
2069 *loadingpath = loading;
2081 if (!ac)
return FALSE;
2095 VALUE load = autoload_data(
mod,
id);
2099 if (!load || !(ele = get_autoload_data(load, &ac))) {
2130 check_before_mod_set(
klass,
id, ac->
value,
"constant");
2131 const_tbl_update(ac);
2154 int need_wakeups = 0;
2171 autoload_const_set((
VALUE)ac);
2229 const char *loading = 0, *
src;
2236 if (!autoload_defined_p(
mod,
id))
return Qfalse;
2237 load = check_autoload_required(
mod,
id, &loading);
2238 if (!load)
return Qfalse;
2247 if (!(ele = get_autoload_data(load, &
ac))) {
2253 ele->
state = &state;
2269 autoload_sleep_done, (
VALUE)&state);
2275 autoload_reset, (
VALUE)&state);
2296 while (!autoload_defined_p(
mod,
id)) {
2301 load = check_autoload_required(
mod,
id, 0);
2302 if (!load)
return Qnil;
2303 return (ele = get_autoload_data(load, 0)) ? ele->
feature :
Qnil;
2322rb_const_get_0(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2324 VALUE c = rb_const_search(
klass,
id, exclude, recurse, visibility);
2325 if (c !=
Qundef)
return c;
2330rb_const_search_from(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2335 while (
RTEST(tmp)) {
2342 GET_EC()->private_const_reference = tmp;
2349 if (am == tmp)
break;
2351 ac = autoloading_const_entry(tmp,
id);
2352 if (ac)
return ac->
value;
2361 if (!recurse)
break;
2366 GET_EC()->private_const_reference = 0;
2371rb_const_search(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2376 value = rb_const_search_from(
klass,
id, exclude, recurse, visibility);
2378 if (exclude)
return value;
2381 return rb_const_search_from(
rb_cObject,
id,
FALSE, recurse, visibility);
2423rb_const_location_from(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2438 if (!recurse)
break;
2447rb_const_location(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2452 loc = rb_const_location_from(
klass,
id, exclude, recurse, visibility);
2453 if (!
NIL_P(loc))
return loc;
2454 if (exclude)
return loc;
2457 return rb_const_location_from(
rb_cObject,
id,
FALSE, recurse, visibility);
2488 undefined_constant(
mod,
name);
2513 autoload_delete(
mod,
id);
2541rb_local_constants_i(
ID const_name,
VALUE const_value,
void *ary)
2632 bool inherit =
true;
2640 return rb_local_constants(
mod);
2645rb_const_defined_0(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2658 if (ce->
value ==
Qundef && !check_autoload_required(tmp,
id, 0) &&
2668 if (!recurse)
break;
2709static void set_namespace_path(
VALUE named_namespace,
VALUE name);
2712set_namespace_path_i(
ID id,
VALUE v,
void *payload)
2716 int has_permanent_classpath;
2721 if (!rb_namespace_p(value)) {
2724 classname(value, &has_permanent_classpath);
2725 if (has_permanent_classpath) {
2728 set_namespace_path(value, build_const_path(parental_path,
id));
2743set_namespace_path(
VALUE named_namespace,
VALUE namespace_path)
2766 check_before_mod_set(
klass,
id, val,
"constant");
2780 const_tbl_update(&ac);
2787 int val_path_permanent;
2788 VALUE val_path = classname(val, &val_path_permanent);
2789 if (
NIL_P(val_path) || !val_path_permanent) {
2794 int parental_path_permanent;
2795 VALUE parental_path = classname(
klass, &parental_path_permanent);
2796 if (!
NIL_P(parental_path)) {
2797 if (parental_path_permanent && !val_path_permanent) {
2798 set_namespace_path(val, build_const_path(parental_path,
id));
2800 else if (!parental_path_permanent &&
NIL_P(val_path)) {
2801 rb_ivar_set(val, tmp_classpath, build_const_path(parental_path,
id));
2813 VALUE load = autoload_data(
mod,
id);
2814 if (!load)
return 0;
2815 ele = get_autoload_data(load, acp);
2848 autoload_delete(
klass,
id);
2849 ce->
flag = visibility;
2858 visibility = ce->
flag;
2870 setup_const_entry(ce,
klass, val, visibility);
2877 setup_const_entry(ce,
klass, val, visibility);
2885 ce->
flag = visibility;
2896 rb_warn(
"rb_define_const: invalid name `%s' for constant",
name);
2932 undefined_constant(
mod, val);
2940 ele = current_autoload_data(
mod,
id, &ac);
3029original_module(
VALUE c)
3048 if (rb_namespace_p(
obj)) {
3058 if (front && target != front) {
3072#define CVAR_FOREACH_ANCESTORS(klass, v, r) \
3073 for (klass = cvar_front_klass(klass); klass; klass = RCLASS_SUPER(klass)) { \
3074 if (cvar_lookup_at(klass, id, (v))) { \
3079#define CVAR_LOOKUP(v,r) do {\
3080 if (cvar_lookup_at(klass, id, (v))) {r;}\
3081 CVAR_FOREACH_ANCESTORS(klass, v, r);\
3087 VALUE tmp, front = 0, target = 0;
3092 cvar_overtaken(front, target,
id);
3098 check_before_mod_set(target,
id, val,
"class variable");
3109 VALUE tmp, front = 0, target = 0;
3118 cvar_overtaken(front, target,
id);
3119 return (
VALUE)value;
3193 data = mod_cvar_at(tmp, data);
3194 tmp = cvar_front_klass(tmp);
3198 data = mod_cvar_at(tmp, data);
3214cvar_list(
void *data)
3250 bool inherit =
true;
3255 tbl = mod_cvar_of(
mod, 0);
3258 tbl = mod_cvar_at(
mod, 0);
3260 return cvar_list(tbl);
rb_encoding * rb_enc_get(VALUE obj)
rb_encoding * rb_usascii_encoding(void)
#define rb_enc_asciicompat(enc)
ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc)
char str[HTML_ESCAPE_MAX_LEN+1]
void rb_class_modify_check(VALUE)
Asserts that klass is not a frozen class.
ID rb_frame_callee(void)
The name of the current method.
void rb_define_virtual_variable(const char *name, rb_gvar_getter_t *getter, rb_gvar_setter_t *setter)
VALUE rb_gv_set(const char *name, VALUE val)
VALUE rb_cObject
Object class.
void rb_define_variable(const char *name, VALUE *var)
void rb_define_global_const(const char *name, VALUE val)
const char * rb_obj_classname(VALUE obj)
VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
void rb_define_const(VALUE klass, const char *name, VALUE val)
void rb_define_readonly_variable(const char *name, const VALUE *var)
VALUE rb_gv_get(const char *name)
void rb_define_hooked_variable(const char *name, VALUE *var, rb_gvar_getter_t *getter, rb_gvar_setter_t *setter)
VALUE rb_iv_get(VALUE obj, const char *name)
VALUE rb_cModule
Module class.
const char * rb_class2name(VALUE klass)
void rb_raise(VALUE exc, const char *fmt,...)
_Bool rb_warning_category_enabled_p(rb_warning_category_t category)
void rb_name_error(ID id, const char *fmt,...)
void rb_name_error_str(VALUE str, const char *fmt,...)
void * rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type)
void rb_warn(const char *fmt,...)
VALUE rb_ensure(VALUE(*)(VALUE), VALUE, VALUE(*)(VALUE), VALUE)
An equivalent to ensure clause.
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
VALUE rb_class_real(VALUE cl)
Looks up the nearest ancestor of cl, skipping singleton classes or module inclusions.
void st_foreach_safe(st_table *table, st_foreach_func *func, st_data_t a)
int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val)
int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp)
void rb_id_table_foreach_values(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data)
size_t rb_id_table_size(const struct rb_id_table *tbl)
struct rb_id_table * rb_id_table_create(size_t capa)
int rb_id_table_delete(struct rb_id_table *tbl, ID id)
void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data)
rb_id_table_iterator_result
MJIT_STATIC void rb_vm_pop_cfunc_frame(void)
unsigned char buf[MIME_BUF_SIZE]
void st_free_table(st_table *tab)
size_t st_memsize(const st_table *tab)
int st_delete(st_table *tab, st_data_t *key, st_data_t *value)
void st_add_direct(st_table *tab, st_data_t key, st_data_t value)
st_table * st_init_numtable(void)
int st_insert(st_table *tab, st_data_t key, st_data_t value)
int st_lookup(st_table *tab, st_data_t key, st_data_t *value)
int st_foreach(st_table *tab, st_foreach_callback_func *func, st_data_t arg)
int st_update(st_table *tab, st_data_t key, st_update_callback_func *func, st_data_t arg)
st_table * st_copy(st_table *old_tab)
struct autoload_state * state
struct list_head constants
struct autoload_const * ac
rb_ivar_foreach_callback_func * func
union ivar_update::@233 u
rb_ivar_foreach_callback_func * func
struct rb_global_variable * var
rb_gvar_marker_t * marker
rb_gvar_getter_t * getter
rb_gvar_setter_t * setter
void(* func)(VALUE arg, VALUE val)
int rb_is_instance_id(ID id)
int rb_is_const_id(ID id)
int rb_is_class_id(ID id)
void * rb_transient_heap_alloc(VALUE obj, size_t req_size)
VALUE rb_mod_remove_cvar(VALUE mod, VALUE name)
VALUE rb_const_get_at(VALUE klass, ID id)
NORETURN(static void uninitialized_constant(VALUE, VALUE))
VALUE rb_obj_instance_variables(VALUE obj)
VALUE rb_f_untrace_var(int argc, const VALUE *argv)
VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj)
VALUE rb_const_list(void *data)
void rb_gvar_val_marker(VALUE *var)
MJIT_FUNC_EXPORTED VALUE rb_public_const_get_from(VALUE klass, ID id)
VALUE rb_cvar_defined(VALUE klass, ID id)
VALUE rb_path2class(const char *path)
#define CVAR_LOOKUP(v, r)
rb_gvar_setter_t * rb_gvar_setter_function_of(const struct rb_global_entry *entry)
void rb_copy_generic_ivar(VALUE clone, VALUE obj)
VALUE rb_gvar_undef_getter(ID id, VALUE *_)
bool rb_gvar_is_traced(const struct rb_global_entry *entry)
VALUE(* fallback_func)(VALUE obj, VALUE name)
VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
void rb_alias_variable(ID name1, ID name2)
void rb_set_class_path(VALUE klass, VALUE under, const char *name)
#define id_for_var_message(obj, name, type, message)
MJIT_FUNC_EXPORTED void rb_const_warn_if_deprecated(const rb_const_entry_t *ce, VALUE klass, ID id)
VALUE rb_attr_delete(VALUE obj, ID id)
MJIT_FUNC_EXPORTED struct st_table * rb_ivar_generic_ivtbl(void)
rb_gvar_getter_t * rb_gvar_getter_function_of(const struct rb_global_entry *entry)
void rb_ivar_set_internal(VALUE obj, ID id, VALUE val)
void rb_deprecate_constant(VALUE mod, const char *name)
void rb_gc_mark_global_tbl(void)
VALUE rb_mod_constants(int argc, const VALUE *argv, VALUE mod)
MJIT_FUNC_EXPORTED int rb_public_const_defined_from(VALUE klass, ID id)
VALUE rb_gvar_val_getter(ID id, VALUE *data)
VALUE rb_const_get(VALUE klass, ID id)
VALUE rb_f_trace_var(int argc, const VALUE *argv)
RUBY_FUNC_EXPORTED size_t rb_generic_ivar_memsize(VALUE obj)
MJIT_FUNC_EXPORTED struct rb_global_entry * rb_global_entry(ID id)
void rb_gvar_var_marker(VALUE *var)
VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef)
void rb_mv_generic_ivar(VALUE rsrc, VALUE dst)
void rb_mark_generic_ivar(VALUE obj)
VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj)
MJIT_FUNC_EXPORTED VALUE rb_gvar_get(struct rb_global_entry *entry)
VALUE rb_search_class_path(VALUE klass)
int rb_ivar_foreach_callback_func(ID key, VALUE val, st_data_t arg)
int rb_class_ivar_set(VALUE obj, ID key, VALUE value)
void rb_gvar_val_setter(VALUE val, ID id, VALUE *_)
void rb_gvar_undef_marker(VALUE *var)
void rb_cvar_set(VALUE klass, ID id, VALUE val)
void rb_iv_tbl_copy(VALUE dst, VALUE src)
void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_)
VALUE rb_autoload_at_p(VALUE mod, ID id, int recur)
void rb_gvar_undef_setter(VALUE val, ID id, VALUE *_)
MJIT_FUNC_EXPORTED int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag)
VALUE rb_cvar_get(VALUE klass, ID id)
VALUE rb_mod_name(VALUE mod)
void rb_ivar_foreach(VALUE obj, rb_ivar_foreach_callback_func *func, st_data_t arg)
VALUE rb_ivar_get(VALUE obj, ID id)
void Init_var_tables(void)
MJIT_FUNC_EXPORTED VALUE rb_const_source_location_at(VALUE klass, ID id)
MJIT_FUNC_EXPORTED rb_const_entry_t * rb_const_lookup(VALUE klass, ID id)
VALUE rb_class_path_cached(VALUE klass)
VALUE rb_autoload_load(VALUE mod, ID id)
void rb_obj_transient_heap_evacuate(VALUE obj, int promote)
void rb_autoload_str(VALUE mod, ID id, VALUE file)
VALUE rb_const_remove(VALUE mod, ID id)
VALUE rb_const_get_from(VALUE klass, ID id)
void rb_set_class_path_string(VALUE klass, VALUE under, VALUE name)
MJIT_FUNC_EXPORTED VALUE rb_gvar_set(struct rb_global_entry *entry, VALUE val)
int rb_const_defined(VALUE klass, ID id)
void rb_const_set(VALUE klass, ID id, VALUE val)
VALUE rb_obj_remove_instance_variable(VALUE obj, VALUE name)
MJIT_FUNC_EXPORTED VALUE rb_gvar_defined(struct rb_global_entry *entry)
VALUE rb_path_to_class(VALUE pathname)
VALUE rb_autoload_p(VALUE mod, ID id)
#define id_for_var(obj, name, part, type)
st_index_t rb_ivar_count(VALUE obj)
void * rb_mod_const_at(VALUE mod, void *data)
VALUE rb_cv_get(VALUE klass, const char *name)
VALUE rb_const_source_location(VALUE klass, ID id)
VALUE rb_const_missing(VALUE klass, VALUE name)
VALUE rb_class_name(VALUE klass)
void rb_cv_set(VALUE klass, const char *name, VALUE val)
VALUE rb_class_path(VALUE klass)
MJIT_FUNC_EXPORTED VALUE rb_public_const_get_at(VALUE klass, ID id)
VALUE rb_mod_class_variables(int argc, const VALUE *argv, VALUE mod)
#define check_autoload_table(av)
VALUE rb_f_global_variables(void)
VALUE rb_attr_get(VALUE obj, ID id)
VALUE rb_mod_const_missing(VALUE klass, VALUE name)
void rb_gvar_var_setter(VALUE val, ID id, VALUE *data)
int rb_const_defined_at(VALUE klass, ID id)
int rb_const_defined_from(VALUE klass, ID id)
VALUE rb_gvar_var_getter(ID id, VALUE *var)
void * rb_mod_const_of(VALUE mod, void *data)
VALUE rb_mod_remove_const(VALUE mod, VALUE name)
RUBY_FUNC_EXPORTED void rb_autoload(VALUE mod, ID id, const char *file)
void rb_define_class_variable(VALUE klass, const char *name, VALUE val)
VALUE rb_ivar_defined(VALUE obj, ID id)
VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj)
void rb_free_generic_ivar(VALUE obj)
VALUE rb_vm_top_self(void)