Ruby
2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)
|
Go to the documentation of this file.
21 #include "ccan/list/list.h"
29 static ID autoload, classpath, tmp_classpath;
30 static VALUE autoload_featuremap;
32 static void check_before_mod_set(
VALUE,
ID,
VALUE,
const char *);
34 static VALUE rb_const_search(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility);
36 static 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);
192 build_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)) {
312 rb_find_global_entry(
ID id)
364 var->
data = (
void*)val;
382 var->
data = (
void*)val;
395 if (!var)
return Qnil;
418 mark_global_entry(
VALUE v,
void *ignored)
441 global_id(
const char *
name)
459 find_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;
850 gen_ivtbl_bytes(
size_t n)
871 gen_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) {
963 gen_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);
1020 gen_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);
1175 obj_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)) {
1753 autoload_mark(
void *
ptr)
1759 autoload_free(
void *
ptr)
1765 autoload_memsize(
const void *
ptr)
1772 autoload_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)
1825 autoload_i_compact(
void *
ptr)
1832 autoload_i_mark(
void *
ptr)
1845 autoload_i_free(
void *
ptr)
1856 autoload_i_memsize(
const void *
ptr)
1863 {autoload_i_mark, autoload_i_free, autoload_i_memsize, autoload_i_compact},
1868 autoload_c_compact(
void *
ptr)
1878 autoload_c_mark(
void *
ptr)
1888 autoload_c_free(
void *
ptr)
1896 autoload_c_memsize(
const void *
ptr)
1903 {autoload_c_mark, autoload_c_free, autoload_c_memsize, autoload_c_compact,},
1926 if (!file || !*file) {
1970 if (!autoload_featuremap) {
1978 &autoload_data_i_type, ele);
1991 &autoload_const_type, ac);
2013 ele = get_autoload_data((
VALUE)load, &ac);
2034 check_autoload_required(
VALUE mod,
ID id,
const char **loadingpath)
2037 VALUE load = autoload_data(
mod,
id);
2039 const char *loading;
2041 if (!load || !(ele = get_autoload_data(load, 0))) {
2064 if (loadingpath && loading) {
2065 *loadingpath = loading;
2077 if (!ac)
return FALSE;
2091 VALUE load = autoload_data(
mod,
id);
2095 if (!load || !(ele = get_autoload_data(load, &ac))) {
2126 check_before_mod_set(
klass,
id, ac->
value,
"constant");
2127 const_tbl_update(ac);
2150 int need_wakeups = 0;
2167 autoload_const_set((
VALUE)ac);
2225 const char *loading = 0, *
src;
2232 if (!autoload_defined_p(
mod,
id))
return Qfalse;
2233 load = check_autoload_required(
mod,
id, &loading);
2234 if (!load)
return Qfalse;
2243 if (!(ele = get_autoload_data(load, &
ac))) {
2249 ele->
state = &state;
2265 autoload_sleep_done, (
VALUE)&state);
2271 autoload_reset, (
VALUE)&state);
2292 while (!autoload_defined_p(
mod,
id)) {
2297 load = check_autoload_required(
mod,
id, 0);
2298 if (!load)
return Qnil;
2299 return (ele = get_autoload_data(load, 0)) ? ele->
feature :
Qnil;
2318 rb_const_get_0(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2320 VALUE c = rb_const_search(
klass,
id, exclude, recurse, visibility);
2321 if (c !=
Qundef)
return c;
2326 rb_const_search_from(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2331 while (
RTEST(tmp)) {
2338 GET_EC()->private_const_reference = tmp;
2345 if (am == tmp)
break;
2347 ac = autoloading_const_entry(tmp,
id);
2348 if (ac)
return ac->
value;
2357 if (!recurse)
break;
2362 GET_EC()->private_const_reference = 0;
2367 rb_const_search(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2372 value = rb_const_search_from(
klass,
id, exclude, recurse, visibility);
2374 if (exclude)
return value;
2377 return rb_const_search_from(
rb_cObject,
id,
FALSE, recurse, visibility);
2419 rb_const_location_from(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2434 if (!recurse)
break;
2443 rb_const_location(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2448 loc = rb_const_location_from(
klass,
id, exclude, recurse, visibility);
2449 if (!
NIL_P(loc))
return loc;
2450 if (exclude)
return loc;
2453 return rb_const_location_from(
rb_cObject,
id,
FALSE, recurse, visibility);
2484 undefined_constant(
mod,
name);
2509 autoload_delete(
mod,
id);
2537 rb_local_constants_i(
ID const_name,
VALUE const_value,
void *ary)
2628 bool inherit =
true;
2636 return rb_local_constants(
mod);
2641 rb_const_defined_0(
VALUE klass,
ID id,
int exclude,
int recurse,
int visibility)
2654 if (ce->
value ==
Qundef && !check_autoload_required(tmp,
id, 0) &&
2664 if (!recurse)
break;
2705 static void set_namespace_path(
VALUE named_namespace,
VALUE name);
2708 set_namespace_path_i(
ID id,
VALUE v,
void *payload)
2712 int has_permanent_classpath;
2717 if (!rb_namespace_p(value)) {
2720 classname(value, &has_permanent_classpath);
2721 if (has_permanent_classpath) {
2724 set_namespace_path(value, build_const_path(parental_path,
id));
2739 set_namespace_path(
VALUE named_namespace,
VALUE namespace_path)
2762 check_before_mod_set(
klass,
id, val,
"constant");
2776 const_tbl_update(&ac);
2783 int val_path_permanent;
2784 VALUE val_path = classname(val, &val_path_permanent);
2785 if (
NIL_P(val_path) || !val_path_permanent) {
2790 int parental_path_permanent;
2791 VALUE parental_path = classname(
klass, &parental_path_permanent);
2792 if (!
NIL_P(parental_path)) {
2793 if (parental_path_permanent && !val_path_permanent) {
2794 set_namespace_path(val, build_const_path(parental_path,
id));
2796 else if (!parental_path_permanent &&
NIL_P(val_path)) {
2797 rb_ivar_set(val, tmp_classpath, build_const_path(parental_path,
id));
2809 VALUE load = autoload_data(
mod,
id);
2810 if (!load)
return 0;
2811 ele = get_autoload_data(load, acp);
2843 autoload_delete(
klass,
id);
2847 visibility = ce->
flag;
2859 setup_const_entry(ce,
klass, val, visibility);
2866 setup_const_entry(ce,
klass, val, visibility);
2874 ce->
flag = visibility;
2885 rb_warn(
"rb_define_const: invalid name `%s' for constant",
name);
2921 undefined_constant(
mod, val);
2929 ele = current_autoload_data(
mod,
id, &ac);
3018 original_module(
VALUE c)
3037 if (rb_namespace_p(
obj)) {
3047 if (front && target != front) {
3061 #define CVAR_FOREACH_ANCESTORS(klass, v, r) \
3062 for (klass = cvar_front_klass(klass); klass; klass = RCLASS_SUPER(klass)) { \
3063 if (cvar_lookup_at(klass, id, (v))) { \
3068 #define CVAR_LOOKUP(v,r) do {\
3069 if (cvar_lookup_at(klass, id, (v))) {r;}\
3070 CVAR_FOREACH_ANCESTORS(klass, v, r);\
3076 VALUE tmp, front = 0, target = 0;
3081 cvar_overtaken(front, target,
id);
3087 check_before_mod_set(target,
id, val,
"class variable");
3098 VALUE tmp, front = 0, target = 0;
3107 cvar_overtaken(front, target,
id);
3108 return (
VALUE)value;
3182 data = mod_cvar_at(tmp, data);
3183 tmp = cvar_front_klass(tmp);
3187 data = mod_cvar_at(tmp, data);
3203 cvar_list(
void *data)
3239 bool inherit =
true;
3244 tbl = mod_cvar_of(
mod, 0);
3247 tbl = mod_cvar_at(
mod, 0);
3249 return cvar_list(tbl);
VALUE rb_f_untrace_var(int argc, const VALUE *argv)
void st_foreach_safe(st_table *table, st_foreach_func *func, st_data_t a)
VALUE rb_gv_set(const char *name, VALUE val)
void * rb_mod_const_of(VALUE mod, void *data)
int rb_class_ivar_set(VALUE obj, ID key, VALUE value)
void rb_ivar_set_internal(VALUE obj, ID id, VALUE val)
st_index_t rb_ivar_count(VALUE obj)
void rb_define_class_variable(VALUE klass, const char *name, VALUE val)
int rb_const_defined(VALUE klass, ID id)
const char * rb_sourcefile(void)
int rb_is_const_id(ID id)
#define TypedData_Make_Struct(klass, type, data_type, sval)
void rb_gvar_var_setter(VALUE val, ID id, VALUE *data)
void rb_free_generic_ivar(VALUE obj)
#define CVAR_LOOKUP(v, r)
void * rb_mod_const_at(VALUE mod, void *data)
ID rb_check_id(volatile VALUE *)
Returns ID for the given name if it is interned already, or 0.
#define ROBJ_TRANSIENT_SET(obj)
VALUE rb_assoc_new(VALUE car, VALUE cdr)
st_table * st_copy(st_table *old_tab)
VALUE rb_cvar_get(VALUE klass, ID id)
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
VALUE rb_thread_wakeup_alive(VALUE)
void rb_class_modify_check(VALUE klass)
Asserts that klass is not a frozen class.
void Init_var_tables(void)
VALUE rb_ident_hash_new(void)
int rb_feature_provided(const char *, const char **)
void rb_gc_register_mark_object(VALUE obj)
rb_gvar_setter_t * rb_gvar_setter_function_of(const struct rb_global_entry *entry)
size_t rb_id_table_size(const struct rb_id_table *tbl)
int rb_match_count(VALUE match)
void rb_warn(const char *fmt,...)
void rb_vm_inc_const_missing_count(void)
void rb_copy_generic_ivar(VALUE clone, VALUE obj)
void rb_gc_update_tbl_refs(st_table *ptr)
void rb_gvar_undef_marker(VALUE *var)
struct rb_global_variable * var
void rb_warning(const char *fmt,...)
VALUE rb_ivar_defined(VALUE obj, ID id)
#define RB_BUILTIN_TYPE(x)
VALUE rb_mod_remove_const(VALUE mod, VALUE name)
#define st_is_member(table, key)
MJIT_FUNC_EXPORTED VALUE rb_const_source_location_at(VALUE klass, ID id)
void rb_mark_tbl_no_pin(st_table *tbl)
MJIT_FUNC_EXPORTED bool rb_warning_category_enabled_p(rb_warning_category_t category)
VALUE rb_gvar_undef_getter(ID id, VALUE *_)
void rb_autoload_str(VALUE mod, ID id, VALUE file)
#define RB_CONST_PRIVATE_P(ce)
MJIT_FUNC_EXPORTED struct rb_global_entry * rb_global_entry(ID id)
VALUE rb_hash_aref(VALUE hash, VALUE key)
st_table * st_init_numtable(void)
void rb_cvar_set(VALUE klass, ID id, VALUE val)
void rb_mark_generic_ivar(VALUE obj)
#define offsetof(p_type, field)
int st_delete(st_table *tab, st_data_t *key, st_data_t *value)
#define RB_TYPE_P(obj, type)
#define rb_intern_const(str)
void rb_gc_mark_global_tbl(void)
VALUE rb_gc_location(VALUE value)
RUBY_EXTERN VALUE rb_cModule
VALUE rb_thread_current(void)
rb_encoding * rb_enc_get(VALUE obj)
void st_add_direct(st_table *tab, st_data_t key, st_data_t value)
#define rb_enc_asciicompat(enc)
rb_id_table_iterator_result
VALUE rb_path2class(const char *path)
int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val)
RUBY_FUNC_EXPORTED void rb_autoload(VALUE mod, ID id, const char *file)
void rb_define_readonly_variable(const char *name, const VALUE *var)
VALUE rb_gvar_getter_t(ID id, VALUE *data)
VALUE rb_cvar_defined(VALUE klass, ID id)
#define id_for_var(obj, name, part, type)
void rb_const_set(VALUE klass, ID id, VALUE val)
rb_gvar_getter_t * getter
VALUE rb_attr_delete(VALUE obj, ID id)
void rb_gvar_setter_t(VALUE val, ID id, VALUE *data)
void rb_name_error(ID id, const char *fmt,...)
MJIT_FUNC_EXPORTED VALUE rb_gvar_set(struct rb_global_entry *entry, VALUE val)
int rb_match_nth_defined(int nth, VALUE match)
#define SPECIAL_CONST_P(x)
VALUE rb_path_to_class(VALUE pathname)
VALUE rb_const_source_location(VALUE klass, ID id)
VALUE rb_const_list(void *data)
void rb_gvar_var_marker(VALUE *var)
#define check_autoload_table(av)
VALUE rb_mod_constants(int argc, const VALUE *argv, VALUE mod)
void rb_gvar_marker_t(VALUE *var)
MJIT_FUNC_EXPORTED int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag)
int st_insert(st_table *tab, st_data_t key, st_data_t value)
VALUE ivptr[FLEX_ARY_LEN]
size_t strlen(const char *)
void rb_alias_variable(ID name1, ID name2)
struct autoload_const * ac
int rb_is_class_id(ID id)
#define RUBY_FUNC_EXPORTED
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_f_global_variables(void)
void rb_thread_sleep_deadly(void)
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
rb_gvar_marker_t * marker
VALUE rb_autoload_load(VALUE mod, ID id)
VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef)
VALUE rb_autoload_at_p(VALUE mod, ID id, int recur)
#define RCLASS_IV_INDEX_TBL(c)
void rb_gc_mark_maybe(VALUE obj)
MJIT_STATIC void rb_vm_pop_cfunc_frame(void)
void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data)
const typedef OnigEncodingType rb_encoding
#define rb_check_frozen(obj)
VALUE rb_str_intern(VALUE)
void rb_gvar_undef_setter(VALUE val, ID id, VALUE *_)
#define id_for_var_message(obj, name, type, message)
#define RCLASS_CONST_TBL(c)
VALUE rb_iv_get(VALUE obj, const char *name)
VALUE rb_search_class_path(VALUE klass)
int rb_const_defined_at(VALUE klass, ID id)
#define ALLOCV_N(type, v, n)
VALUE rb_f_trace_var(int argc, const VALUE *argv)
unsigned long rb_serial_t
VALUE rb_vm_top_self(void)
#define RB_OBJ_WRITTEN(a, oldv, b)
RUBY_FUNC_EXPORTED size_t rb_generic_ivar_memsize(VALUE obj)
void rb_clear_constant_cache(void)
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
void(* func)(VALUE arg, VALUE val)
VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj)
void rb_set_class_path_string(VALUE klass, VALUE under, VALUE name)
int rb_ivar_foreach_callback_func(ID key, VALUE val, st_data_t arg)
VALUE rb_ary_push(VALUE ary, VALUE item)
VALUE rb_obj_remove_instance_variable(VALUE obj, VALUE name)
#define TypedData_Wrap_Struct(klass, data_type, sval)
void rb_obj_transient_heap_evacuate(VALUE obj, int promote)
bool rb_gvar_is_traced(const struct rb_global_entry *entry)
void rb_define_hooked_variable(const char *name, VALUE *var, rb_gvar_getter_t *getter, rb_gvar_setter_t *setter)
VALUE rb_class_path_cached(VALUE klass)
void rb_gvar_val_setter(VALUE val, ID id, VALUE *_)
VALUE rb_attr_get(VALUE obj, ID id)
VALUE rb_eval_cmd_kw(VALUE, VALUE, int)
void * rb_transient_heap_alloc(VALUE obj, size_t req_size)
int rb_is_instance_id(ID id)
VALUE rb_backref_get(void)
void rb_gc_mark_movable(VALUE ptr)
void rb_set_class_path(VALUE klass, VALUE under, const char *name)
const char * rb_class2name(VALUE klass)
VALUE rb_str_new_frozen(VALUE)
void rb_gvar_val_marker(VALUE *var)
VALUE rb_gvar_var_getter(ID id, VALUE *var)
MJIT_FUNC_EXPORTED VALUE rb_public_const_get_at(VALUE klass, ID id)
void rb_define_variable(const char *name, VALUE *var)
#define RB_OBJ_WRITE(a, slot, b)
#define ROBJ_TRANSIENT_UNSET(obj)
VALUE rb_fstring_new(const char *ptr, long len)
int st_update(st_table *tab, st_data_t key, st_update_callback_func *func, st_data_t arg)
VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
#define RB_CONST_DEPRECATED_P(ce)
ID rb_frame_callee(void)
The name of the current method.
void rb_iv_tbl_copy(VALUE dst, VALUE src)
int st_foreach(st_table *tab, st_foreach_callback_func *func, st_data_t arg)
VALUE rb_const_remove(VALUE mod, ID id)
VALUE rb_const_missing(VALUE klass, VALUE name)
VALUE rb_ivar_get(VALUE obj, ID id)
RUBY_EXTERN VALUE rb_cObject
MJIT_FUNC_EXPORTED rb_const_entry_t * rb_const_lookup(VALUE klass, ID id)
VALUE rb_const_get_from(VALUE klass, ID id)
unsigned char buf[MIME_BUF_SIZE]
ID rb_intern2(const char *, long)
VALUE rb_str_append(VALUE, VALUE)
struct list_head constants
#define ROBJ_TRANSIENT_P(obj)
void rb_define_global_const(const char *name, VALUE val)
#define RB_CONST_PUBLIC_P(ce)
VALUE rb_autoload_p(VALUE mod, ID id)
VALUE rb_sprintf(const char *format,...)
VALUE rb_gvar_val_getter(ID id, VALUE *data)
rb_gvar_getter_t * rb_gvar_getter_function_of(const struct rb_global_entry *entry)
VALUE rb_str_subseq(VALUE, long, long)
void rb_ivar_foreach(VALUE obj, rb_ivar_foreach_callback_func *func, st_data_t arg)
MJIT_FUNC_EXPORTED VALUE rb_public_const_get_from(VALUE klass, ID id)
VALUE rb_obj_instance_variables(VALUE obj)
char str[HTML_ESCAPE_MAX_LEN+1]
struct autoload_state * state
VALUE(* fallback_func)(VALUE obj, VALUE name)
#define RUBY_TYPED_FREE_IMMEDIATELY
void rb_mv_generic_ivar(VALUE rsrc, VALUE dst)
#define MEMCPY(p1, p2, type, n)
VALUE rb_const_get(VALUE klass, ID id)
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
rb_gvar_setter_t * setter
void rb_deprecate_constant(VALUE mod, const char *name)
MJIT_FUNC_EXPORTED void rb_const_warn_if_deprecated(const rb_const_entry_t *ce, VALUE klass, ID id)
VALUE rb_hash_delete(VALUE hash, VALUE key)
struct rb_id_table * rb_id_table_create(size_t capa)
ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc)
const char * rb_obj_classname(VALUE obj)
#define REALLOC_N(var, type, n)
void rb_name_error_str(VALUE str, const char *fmt,...)
void rb_define_const(VALUE klass, const char *name, VALUE val)
void rb_cv_set(VALUE klass, const char *name, VALUE val)
int rb_thread_to_be_killed(VALUE thread)
#define rb_name_err_raise_str(mesg, recv, name)
VALUE rb_mod_remove_cvar(VALUE mod, VALUE name)
void rb_gc_mark(VALUE ptr)
#define MJIT_FUNC_EXPORTED
void * rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type)
void rb_compile_warn(const char *file, int line, const char *fmt,...)
MJIT_FUNC_EXPORTED VALUE rb_gvar_defined(struct rb_global_entry *entry)
int rb_const_defined_from(VALUE klass, ID id)
size_t st_memsize(const st_table *tab)
NORETURN(static void uninitialized_constant(VALUE, VALUE))
#define RB_DEBUG_COUNTER_INC(type)
VALUE rb_class_path(VALUE klass)
void rb_define_virtual_variable(const char *name, rb_gvar_getter_t *getter, rb_gvar_setter_t *setter)
VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj)
VALUE rb_class_name(VALUE klass)
VALUE rb_mod_class_variables(int argc, const VALUE *argv, VALUE mod)
void rb_id_table_foreach_values(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data)
VALUE rb_gv_get(const char *name)
MJIT_FUNC_EXPORTED int rb_public_const_defined_from(VALUE klass, ID id)
VALUE rb_ensure(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*e_proc)(VALUE), VALUE data2)
An equivalent to ensure clause.
@ RB_WARN_CATEGORY_DEPRECATED
union ivar_update::@169 u
int rb_id_table_delete(struct rb_id_table *tbl, ID id)
void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_)
rb_ivar_foreach_callback_func * func
int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp)
VALUE rb_mod_name(VALUE mod)
VALUE rb_cv_get(VALUE klass, const char *name)
int st_lookup(st_table *tab, st_data_t key, st_data_t *value)
#define rb_name_err_raise(mesg, recv, name)
#define UNREACHABLE_RETURN(val)
VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj)
void st_free_table(st_table *tab)
VALUE rb_const_get_at(VALUE klass, ID id)
VALUE rb_mod_const_missing(VALUE klass, VALUE name)
MJIT_FUNC_EXPORTED struct st_table * rb_ivar_generic_ivtbl(void)
#define RB_SPECIAL_CONST_P(x)
VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
rb_encoding * rb_usascii_encoding(void)
#define ROBJECT_IV_INDEX_TBL(o)
rb_ivar_foreach_callback_func * func
MJIT_FUNC_EXPORTED VALUE rb_gvar_get(struct rb_global_entry *entry)
VALUE rb_source_location(int *pline)
VALUE rb_class_real(VALUE cl)
Looks up the nearest ancestor of cl, skipping singleton classes or module inclusions.
VALUE rb_block_proc(void)