Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | Typedefs | Functions | Variables
variable.c File Reference
#include "internal.h"
#include "ruby/st.h"
#include "ruby/util.h"
#include "id_table.h"
#include "constant.h"
#include "id.h"
#include "ccan/list/list.h"
Include dependency graph for variable.c:

Go to the source code of this file.

Data Structures

struct  gen_ivtbl
 
struct  ivar_update
 
struct  fc_result
 
struct  trace_var
 
struct  rb_global_variable
 
struct  trace_data
 
struct  gen_ivar_compat_tbl
 
struct  obj_ivar_tag
 
struct  gen_ivar_tag
 
struct  givar_copy
 
struct  autoload_state
 
struct  autoload_data_i
 
struct  autoload_const_set_args
 

Macros

#define rb_is_constant_id   rb_is_const_id
 
#define rb_is_constant_name   rb_is_const_name
 
#define id_for_var(obj, name, part, type)   id_for_var_message(obj, name, type, "`%1$s' is not allowed as "#part" "#type" variable name")
 
#define id_for_var_message(obj, name, type, message)   check_id_type(obj, &(name), rb_is_##type##_id, rb_is_##type##_name, message, strlen(message))
 
#define check_autoload_table(av)   (struct st_table *)rb_check_typeddata((av), &autoload_data_type)
 
#define check_autoload_data(av)   (struct autoload_data_i *)rb_check_typeddata((av), &autoload_data_i_type)
 
#define CVAR_FOREACH_ANCESTORS(klass, v, r)
 
#define CVAR_LOOKUP(v, r)
 

Typedefs

typedef VALUE(* path_cache_func) (VALUE obj, VALUE name)
 

Functions

static void check_before_mod_set (VALUE, ID, VALUE, const char *)
 
static void setup_const_entry (rb_const_entry_t *, VALUE, VALUE, rb_const_flag_t)
 
static VALUE rb_const_search (VALUE klass, ID id, int exclude, int recurse, int visibility)
 
void Init_var_tables (void)
 
static VALUE fc_path (struct fc_result *fc, ID name)
 
static enum rb_id_table_iterator_result fc_i (ID key, VALUE v, void *a)
 
static VALUE find_class_path (VALUE klass, ID preferred)
 Traverse constant namespace and find +classpath+ for klass. More...
 
static VALUE classname (VALUE klass, int *permanent)
 Returns +classpath+ of klass, if it is named, or +nil+ for anonymous +class+/+module+. More...
 
VALUE rb_mod_name (VALUE mod)
 
static VALUE make_temporary_path (VALUE obj, VALUE klass)
 
static VALUE rb_tmp_class_path (VALUE klass, int *permanent, path_cache_func cache_path)
 
static VALUE ivar_cache (VALUE obj, VALUE name)
 
VALUE rb_class_path (VALUE klass)
 
static VALUE null_cache (VALUE obj, VALUE name)
 
VALUE rb_class_path_no_cache (VALUE klass)
 
VALUE rb_class_path_cached (VALUE klass)
 
static VALUE never_cache (VALUE obj, VALUE name)
 
VALUE rb_search_class_path (VALUE klass)
 
void rb_set_class_path_string (VALUE klass, VALUE under, VALUE name)
 
void rb_set_class_path (VALUE klass, VALUE under, const char *name)
 
VALUE rb_path_to_class (VALUE pathname)
 
VALUE rb_path2class (const char *path)
 
void rb_name_class (VALUE klass, ID id)
 
VALUE rb_class_name (VALUE klass)
 
const char * rb_class2name (VALUE klass)
 
const char * rb_obj_classname (VALUE obj)
 
struct rb_global_entryrb_global_entry (ID id)
 
VALUE rb_gvar_undef_getter (ID id, void *data, struct rb_global_variable *var)
 
void rb_gvar_undef_setter (VALUE val, ID id, void *d, struct rb_global_variable *var)
 
void rb_gvar_undef_marker (VALUE *var)
 
VALUE rb_gvar_val_getter (ID id, void *data, struct rb_global_variable *var)
 
void rb_gvar_val_setter (VALUE val, ID id, void *data, struct rb_global_variable *var)
 
void rb_gvar_val_marker (VALUE *var)
 
VALUE rb_gvar_var_getter (ID id, void *data, struct rb_global_variable *gvar)
 
void rb_gvar_var_setter (VALUE val, ID id, void *data, struct rb_global_variable *g)
 
void rb_gvar_var_marker (VALUE *var)
 
void rb_gvar_readonly_setter (VALUE v, ID id, void *d, struct rb_global_variable *g)
 
static enum rb_id_table_iterator_result mark_global_entry (VALUE v, void *ignored)
 
void rb_gc_mark_global_tbl (void)
 
static ID global_id (const char *name)
 
void rb_define_hooked_variable (const char *name, VALUE *var, VALUE(*getter)(ANYARGS), void(*setter)(ANYARGS))
 
void rb_define_variable (const char *name, VALUE *var)
 
void rb_define_readonly_variable (const char *name, const VALUE *var)
 
void rb_define_virtual_variable (const char *name, VALUE(*getter)(ANYARGS), void(*setter)(ANYARGS))
 
static void rb_trace_eval (VALUE cmd, VALUE val)
 
VALUE rb_f_trace_var (int argc, const VALUE *argv)
 
static void remove_trace (struct rb_global_variable *var)
 
VALUE rb_f_untrace_var (int argc, const VALUE *argv)
 
VALUE rb_gvar_get (struct rb_global_entry *entry)
 
static VALUE trace_ev (struct trace_data *data)
 
static VALUE trace_en (struct rb_global_variable *var)
 
VALUE rb_gvar_set (struct rb_global_entry *entry, VALUE val)
 
VALUE rb_gv_set (const char *name, VALUE val)
 
VALUE rb_gv_get (const char *name)
 
VALUE rb_gvar_defined (struct rb_global_entry *entry)
 
static enum rb_id_table_iterator_result gvar_i (ID key, VALUE val, void *a)
 
VALUE rb_f_global_variables (void)
 
void rb_alias_variable (ID name1, ID name2)
 
static int gen_ivar_compat_tbl_i (st_data_t id, st_data_t index, st_data_t arg)
 
static int gen_ivtbl_get (VALUE obj, struct gen_ivtbl **ivtbl)
 
st_tablerb_generic_ivar_table (VALUE obj)
 
static VALUE generic_ivar_delete (VALUE obj, ID id, VALUE undef)
 
static VALUE generic_ivar_get (VALUE obj, ID id, VALUE undef)
 
static size_t gen_ivtbl_bytes (size_t n)
 
static struct gen_ivtblgen_ivtbl_resize (struct gen_ivtbl *old, uint32_t n)
 
static uint32_t iv_index_tbl_newsize (struct ivar_update *ivup)
 
static int generic_ivar_update (st_data_t *k, st_data_t *v, st_data_t u, int existing)
 
static VALUE generic_ivar_defined (VALUE obj, ID id)
 
static int generic_ivar_remove (VALUE obj, ID id, VALUE *valp)
 
static void gen_ivtbl_mark (const struct gen_ivtbl *ivtbl)
 
void rb_mark_generic_ivar (VALUE obj)
 
void rb_free_generic_ivar (VALUE obj)
 
RUBY_FUNC_EXPORTED size_t rb_generic_ivar_memsize (VALUE obj)
 
static size_t gen_ivtbl_count (const struct gen_ivtbl *ivtbl)
 
VALUE rb_ivar_lookup (VALUE obj, ID id, VALUE undef)
 
VALUE rb_ivar_get (VALUE obj, ID id)
 
VALUE rb_attr_get (VALUE obj, ID id)
 
static VALUE rb_ivar_delete (VALUE obj, ID id, VALUE undef)
 
VALUE rb_attr_delete (VALUE obj, ID id)
 
static st_tableiv_index_tbl_make (VALUE obj)
 
static void iv_index_tbl_extend (struct ivar_update *ivup, ID id)
 
static void generic_ivar_set (VALUE obj, ID id, VALUE val)
 
VALUE rb_ivar_set (VALUE obj, ID id, VALUE val)
 
VALUE rb_ivar_defined (VALUE obj, ID id)
 
static int obj_ivar_i (st_data_t key, st_data_t index, st_data_t arg)
 
static void obj_ivar_each (VALUE obj, int(*func)(ANYARGS), st_data_t arg)
 
static int gen_ivar_each_i (st_data_t key, st_data_t index, st_data_t data)
 
static void gen_ivar_each (VALUE obj, int(*func)(ANYARGS), st_data_t arg)
 
static int gen_ivar_copy (ID id, VALUE val, st_data_t arg)
 
void rb_copy_generic_ivar (VALUE clone, VALUE obj)
 
void rb_ivar_foreach (VALUE obj, int(*func)(ANYARGS), st_data_t arg)
 
st_index_t rb_ivar_count (VALUE obj)
 
static int ivar_i (st_data_t k, st_data_t v, st_data_t a)
 
VALUE rb_obj_instance_variables (VALUE obj)
 
static ID check_id_type (VALUE obj, VALUE *pname, int(*valid_id_p)(ID), int(*valid_name_p)(VALUE), const char *message, size_t message_len)
 
VALUE rb_obj_remove_instance_variable (VALUE obj, VALUE name)
 
 NORETURN (static void uninitialized_constant(VALUE, VALUE))
 
static void uninitialized_constant (VALUE klass, VALUE name)
 
VALUE rb_const_missing (VALUE klass, VALUE name)
 
VALUE rb_mod_const_missing (VALUE klass, VALUE name)
 
static void autoload_mark (void *ptr)
 
static void autoload_free (void *ptr)
 
static size_t autoload_memsize (const void *ptr)
 
static VALUE autoload_data (VALUE mod, ID id)
 
static void autoload_i_mark (void *ptr)
 
static size_t autoload_i_memsize (const void *ptr)
 
void rb_autoload (VALUE mod, ID id, const char *file)
 
void rb_autoload_str (VALUE mod, ID id, VALUE file)
 
static void autoload_delete (VALUE mod, ID id)
 
static VALUE autoload_provided (VALUE arg)
 
static VALUE reset_safe (VALUE safe)
 
static VALUE check_autoload_required (VALUE mod, ID id, const char **loadingpath)
 
int rb_autoloading_value (VALUE mod, ID id, VALUE *value)
 
static int autoload_defined_p (VALUE mod, ID id)
 
static void const_tbl_update (struct autoload_const_set_args *)
 
static VALUE autoload_const_set (VALUE arg)
 
static VALUE autoload_require (VALUE arg)
 
static VALUE autoload_reset (VALUE arg)
 
static VALUE autoload_sleep (VALUE arg)
 
static VALUE autoload_sleep_done (VALUE arg)
 
VALUE rb_autoload_load (VALUE mod, ID id)
 
VALUE rb_autoload_p (VALUE mod, ID id)
 
void rb_const_warn_if_deprecated (const rb_const_entry_t *ce, VALUE klass, ID id)
 
static VALUE rb_const_get_0 (VALUE klass, ID id, int exclude, int recurse, int visibility)
 
VALUE rb_const_get_from (VALUE klass, ID id)
 
VALUE rb_const_get (VALUE klass, ID id)
 
VALUE rb_const_get_at (VALUE klass, ID id)
 
VALUE rb_public_const_get_from (VALUE klass, ID id)
 
VALUE rb_public_const_get (VALUE klass, ID id)
 
VALUE rb_public_const_get_at (VALUE klass, ID id)
 
VALUE rb_mod_remove_const (VALUE mod, VALUE name)
 
VALUE rb_const_remove (VALUE mod, ID id)
 
static int cv_i_update (st_data_t *k, st_data_t *v, st_data_t a, int existing)
 
static enum rb_id_table_iterator_result sv_i (ID key, VALUE v, void *a)
 
static enum rb_id_table_iterator_result rb_local_constants_i (ID const_name, VALUE const_value, void *ary)
 
static VALUE rb_local_constants (VALUE mod)
 
void * rb_mod_const_at (VALUE mod, void *data)
 
void * rb_mod_const_of (VALUE mod, void *data)
 
static int list_i (st_data_t key, st_data_t value, VALUE ary)
 
VALUE rb_const_list (void *data)
 
VALUE rb_mod_constants (int argc, const VALUE *argv, VALUE mod)
 
static int rb_const_defined_0 (VALUE klass, ID id, int exclude, int recurse, int visibility)
 
int rb_const_defined_from (VALUE klass, ID id)
 
int rb_const_defined (VALUE klass, ID id)
 
int rb_const_defined_at (VALUE klass, ID id)
 
int rb_public_const_defined_from (VALUE klass, ID id)
 
int rb_public_const_defined (VALUE klass, ID id)
 
int rb_public_const_defined_at (VALUE klass, ID id)
 
void rb_const_set (VALUE klass, ID id, VALUE val)
 
void rb_define_const (VALUE klass, const char *name, VALUE val)
 
void rb_define_global_const (const char *name, VALUE val)
 
static void set_const_visibility (VALUE mod, int argc, const VALUE *argv, rb_const_flag_t flag, rb_const_flag_t mask)
 
void rb_deprecate_constant (VALUE mod, const char *name)
 
VALUE rb_mod_private_constant (int argc, const VALUE *argv, VALUE obj)
 
VALUE rb_mod_public_constant (int argc, const VALUE *argv, VALUE obj)
 
VALUE rb_mod_deprecate_constant (int argc, const VALUE *argv, VALUE obj)
 
static VALUE original_module (VALUE c)
 
static int cvar_lookup_at (VALUE klass, ID id, st_data_t *v)
 
static VALUE cvar_front_klass (VALUE klass)
 
void rb_cvar_set (VALUE klass, ID id, VALUE val)
 
VALUE rb_cvar_get (VALUE klass, ID id)
 
VALUE rb_cvar_defined (VALUE klass, ID id)
 
static ID cv_intern (VALUE klass, const char *name)
 
void rb_cv_set (VALUE klass, const char *name, VALUE val)
 
VALUE rb_cv_get (VALUE klass, const char *name)
 
void rb_define_class_variable (VALUE klass, const char *name, VALUE val)
 
static int cv_i (st_data_t k, st_data_t v, st_data_t a)
 
static void * mod_cvar_at (VALUE mod, void *data)
 
static void * mod_cvar_of (VALUE mod, void *data)
 
static int cv_list_i (st_data_t key, st_data_t value, VALUE ary)
 
static VALUE cvar_list (void *data)
 
VALUE rb_mod_class_variables (int argc, const VALUE *argv, VALUE mod)
 
VALUE rb_mod_remove_cvar (VALUE mod, VALUE name)
 
VALUE rb_iv_get (VALUE obj, const char *name)
 
VALUE rb_iv_set (VALUE obj, const char *name, VALUE val)
 
int rb_class_ivar_set (VALUE obj, ID key, VALUE value)
 
static int tbl_copy_i (st_data_t key, st_data_t value, st_data_t data)
 
st_tablerb_st_copy (VALUE obj, struct st_table *orig_tbl)
 
rb_const_entry_trb_const_lookup (VALUE klass, ID id)
 

Variables

struct rb_id_table * rb_global_tbl
 
static ID autoload
 
static ID classpath
 
static ID tmp_classpath
 
static ID classid
 
static st_tablegeneric_iv_tbl
 
static st_tablegeneric_iv_tbl_compat
 
static const rb_data_type_t autoload_data_type
 
static const rb_data_type_t autoload_data_i_type
 

Macro Definition Documentation

◆ check_autoload_data

#define check_autoload_data (   av)    (struct autoload_data_i *)rb_check_typeddata((av), &autoload_data_i_type)

◆ check_autoload_table

#define check_autoload_table (   av)    (struct st_table *)rb_check_typeddata((av), &autoload_data_type)

Definition at line 1872 of file variable.c.

Referenced by autoload_data(), autoload_delete(), and rb_autoload_str().

◆ CVAR_FOREACH_ANCESTORS

#define CVAR_FOREACH_ANCESTORS (   klass,
  v,
 
)
Value:
for (klass = cvar_front_klass(klass); klass; klass = RCLASS_SUPER(klass)) { \
if (cvar_lookup_at(klass, id, (v))) { \
r; \
} \
}
static int cvar_lookup_at(VALUE klass, ID id, st_data_t *v)
Definition: variable.c:2858
static VALUE cvar_front_klass(VALUE klass)
Definition: variable.c:2865
#define RCLASS_SUPER(c)
Definition: classext.h:16

Definition at line 2876 of file variable.c.

◆ CVAR_LOOKUP

#define CVAR_LOOKUP (   v,
 
)
Value:
do {\
if (cvar_lookup_at(klass, id, (v))) {r;}\
CVAR_FOREACH_ANCESTORS(klass, v, r);\
} while(0)
static int cvar_lookup_at(VALUE klass, ID id, st_data_t *v)
Definition: variable.c:2858

Definition at line 2883 of file variable.c.

Referenced by rb_cvar_defined(), rb_cvar_get(), and rb_cvar_set().

◆ id_for_var

#define id_for_var (   obj,
  name,
  part,
  type 
)    id_for_var_message(obj, name, type, "`%1$s' is not allowed as "#part" "#type" variable name")

Definition at line 1692 of file variable.c.

Referenced by rb_mod_remove_const(), and rb_obj_remove_instance_variable().

◆ id_for_var_message

#define id_for_var_message (   obj,
  name,
  type,
  message 
)    check_id_type(obj, &(name), rb_is_##type##_id, rb_is_##type##_name, message, strlen(message))

Definition at line 1694 of file variable.c.

Referenced by rb_mod_remove_cvar().

◆ rb_is_constant_id

#define rb_is_constant_id   rb_is_const_id

Definition at line 1690 of file variable.c.

◆ rb_is_constant_name

#define rb_is_constant_name   rb_is_const_name

Definition at line 1691 of file variable.c.

Typedef Documentation

◆ path_cache_func

typedef VALUE(* path_cache_func) (VALUE obj, VALUE name)

Definition at line 256 of file variable.c.

Function Documentation

◆ autoload_const_set()

static VALUE autoload_const_set ( VALUE  arg)
static

◆ autoload_data()

static VALUE autoload_data ( VALUE  mod,
ID  id 
)
static

◆ autoload_defined_p()

static int autoload_defined_p ( VALUE  mod,
ID  id 
)
static

◆ autoload_delete()

static void autoload_delete ( VALUE  mod,
ID  id 
)
static

◆ autoload_free()

static void autoload_free ( void *  ptr)
static

Definition at line 1854 of file variable.c.

References st_free_table.

◆ autoload_i_mark()

static void autoload_i_mark ( void *  ptr)
static

Definition at line 1910 of file variable.c.

References autoload_data_i::feature, rb_gc_mark(), and autoload_data_i::value.

◆ autoload_i_memsize()

static size_t autoload_i_memsize ( const void *  ptr)
static

Definition at line 1918 of file variable.c.

◆ autoload_mark()

static void autoload_mark ( void *  ptr)
static

Definition at line 1848 of file variable.c.

References rb_mark_tbl().

◆ autoload_memsize()

static size_t autoload_memsize ( const void *  ptr)
static

Definition at line 1860 of file variable.c.

References st_memsize().

◆ autoload_provided()

static VALUE autoload_provided ( VALUE  arg)
static

Definition at line 2008 of file variable.c.

References rb_feature_provided().

Referenced by check_autoload_required().

◆ autoload_require()

static VALUE autoload_require ( VALUE  arg)
static

◆ autoload_reset()

static VALUE autoload_reset ( VALUE  arg)
static

◆ autoload_sleep()

static VALUE autoload_sleep ( VALUE  arg)
static

Definition at line 2170 of file variable.c.

References Qfalse, rb_thread_sleep_deadly(), and autoload_state::thread.

Referenced by rb_autoload_load().

◆ autoload_sleep_done()

static VALUE autoload_sleep_done ( VALUE  arg)
static

◆ check_autoload_required()

static VALUE check_autoload_required ( VALUE  mod,
ID  id,
const char **  loadingpath 
)
static

◆ check_before_mod_set()

static void check_before_mod_set ( VALUE  klass,
ID  id,
VALUE  val,
const char *  dest 
)
static

Definition at line 2610 of file variable.c.

References rb_check_frozen.

Referenced by autoload_const_set(), rb_const_set(), and rb_cvar_set().

◆ check_id_type()

static ID check_id_type ( VALUE  obj,
VALUE pname,
int(*)(ID valid_id_p,
int(*)(VALUE valid_name_p,
const char *  message,
size_t  message_len 
)
static

Definition at line 1697 of file variable.c.

References id, rb_check_id(), rb_fstring_new(), and rb_name_err_raise_str.

◆ classname()

static VALUE classname ( VALUE  klass,
int *  permanent 
)
static

Returns +classpath+ of klass, if it is named, or +nil+ for anonymous +class+/+module+.

The last part of named +classpath+ is never anonymous, but anonymous +class+/+module+ names may be contained. If the path is "permanent", that means it has no anonymous names, *permanent is set to 1.

Definition at line 178 of file variable.c.

References classid, classpath, find_class_path(), NIL_P, fc_result::path, Qnil, rb_bug(), rb_check_id(), rb_cObject, rb_id2str, RB_TYPE_P, RCLASS_IV_TBL, st_data_t, st_lookup, T_STRING, and tmp_classpath.

Referenced by rb_cmperr(), rb_mod_name(), rb_tmp_class_path(), and ruby_th_dtrace_setup().

◆ const_tbl_update()

static void const_tbl_update ( struct autoload_const_set_args args)
static

◆ cv_i()

static int cv_i ( st_data_t  k,
st_data_t  v,
st_data_t  a 
)
static

Definition at line 2989 of file variable.c.

References cv_i_update(), key, rb_is_class_id(), ST_CONTINUE, st_data_t, and st_update().

Referenced by mod_cvar_at().

◆ cv_i_update()

static int cv_i_update ( st_data_t k,
st_data_t v,
st_data_t  a,
int  existing 
)
static

Definition at line 2415 of file variable.c.

References ST_CONTINUE, and ST_STOP.

Referenced by cv_i(), and sv_i().

◆ cv_intern()

static ID cv_intern ( VALUE  klass,
const char *  name 
)
static

◆ cv_list_i()

static int cv_list_i ( st_data_t  key,
st_data_t  value,
VALUE  ary 
)
static

Definition at line 3026 of file variable.c.

References ID2SYM, rb_ary_push(), ST_CONTINUE, and sym.

Referenced by cvar_list().

◆ cvar_front_klass()

static VALUE cvar_front_klass ( VALUE  klass)
static

Definition at line 2865 of file variable.c.

References FL_SINGLETON, FL_TEST, rb_ivar_get(), RB_TYPE_P, RCLASS_SUPER, T_CLASS, and T_MODULE.

◆ cvar_list()

static VALUE cvar_list ( void *  data)
static

◆ cvar_lookup_at()

static int cvar_lookup_at ( VALUE  klass,
ID  id,
st_data_t v 
)
static

Definition at line 2858 of file variable.c.

References RCLASS_IV_TBL, st_data_t, and st_lookup.

◆ fc_i()

static enum rb_id_table_iterator_result fc_i ( ID  key,
VALUE  v,
void *  a 
)
static

◆ fc_path()

static VALUE fc_path ( struct fc_result fc,
ID  name 
)
static

◆ find_class_path()

static VALUE find_class_path ( VALUE  klass,
ID  preferred 
)
static

Traverse constant namespace and find +classpath+ for klass.

If preferred is not 0, choice the path whose base name is set to it. If +classpath+ is found, the hidden instance variable classpath is set to the found path, and tmp_classpath is removed. The path is frozen.

Definition at line 144 of file variable.c.

References classpath, fc_i(), fc_result::klass, fc_result::name, fc_result::path, fc_result::preferred, fc_result::prev, Qnil, rb_class_ivar_set(), rb_cObject, rb_id_table_foreach(), RCLASS_CONST_TBL, RCLASS_IV_TBL, st_data_t, st_delete, st_init_numtable, tmp_classpath, and fc_result::track.

Referenced by classname().

◆ gen_ivar_compat_tbl_i()

static int gen_ivar_compat_tbl_i ( st_data_t  id,
st_data_t  index,
st_data_t  arg 
)
static

◆ gen_ivar_copy()

static int gen_ivar_copy ( ID  id,
VALUE  val,
st_data_t  arg 
)
static

◆ gen_ivar_each()

static void gen_ivar_each ( VALUE  obj,
int(*)(ANYARGS func,
st_data_t  arg 
)
static

◆ gen_ivar_each_i()

static int gen_ivar_each_i ( st_data_t  key,
st_data_t  index,
st_data_t  data 
)
static

◆ gen_ivtbl_bytes()

static size_t gen_ivtbl_bytes ( size_t  n)
static

Definition at line 1050 of file variable.c.

Referenced by gen_ivtbl_resize(), and rb_generic_ivar_memsize().

◆ gen_ivtbl_count()

static size_t gen_ivtbl_count ( const struct gen_ivtbl ivtbl)
static

Definition at line 1210 of file variable.c.

References gen_ivtbl::ivptr, gen_ivtbl::numiv, and Qundef.

Referenced by rb_copy_generic_ivar(), and rb_ivar_count().

◆ gen_ivtbl_get()

static int gen_ivtbl_get ( VALUE  obj,
struct gen_ivtbl **  ivtbl 
)
static

◆ gen_ivtbl_mark()

static void gen_ivtbl_mark ( const struct gen_ivtbl ivtbl)
static

Definition at line 1163 of file variable.c.

References gen_ivtbl::ivptr, gen_ivtbl::numiv, and rb_gc_mark().

Referenced by rb_mark_generic_ivar().

◆ gen_ivtbl_resize()

static struct gen_ivtbl* gen_ivtbl_resize ( struct gen_ivtbl old,
uint32_t  n 
)
static

◆ generic_ivar_defined()

static VALUE generic_ivar_defined ( VALUE  obj,
ID  id 
)
static

◆ generic_ivar_delete()

static VALUE generic_ivar_delete ( VALUE  obj,
ID  id,
VALUE  undef 
)
static

◆ generic_ivar_get()

static VALUE generic_ivar_get ( VALUE  obj,
ID  id,
VALUE  undef 
)
static

◆ generic_ivar_remove()

static int generic_ivar_remove ( VALUE  obj,
ID  id,
VALUE valp 
)
static

◆ generic_ivar_set()

static void generic_ivar_set ( VALUE  obj,
ID  id,
VALUE  val 
)
static

◆ generic_ivar_update()

static int generic_ivar_update ( st_data_t k,
st_data_t v,
st_data_t  u,
int  existing 
)
static

◆ global_id()

static ID global_id ( const char *  name)
static

Definition at line 600 of file variable.c.

References ALLOCA_N, buf, id, len, memcpy, rb_intern, rb_intern2(), and strlen().

Referenced by rb_define_hooked_variable(), rb_gv_get(), and rb_gv_set().

◆ gvar_i()

static enum rb_id_table_iterator_result gvar_i ( ID  key,
VALUE  val,
void *  a 
)
static

Definition at line 866 of file variable.c.

References ID2SYM, ID_TABLE_CONTINUE, and rb_ary_push().

Referenced by rb_f_global_variables().

◆ Init_var_tables()

void Init_var_tables ( void  )

◆ iv_index_tbl_extend()

static void iv_index_tbl_extend ( struct ivar_update ivup,
ID  id 
)
static

◆ iv_index_tbl_make()

static st_table* iv_index_tbl_make ( VALUE  obj)
static

◆ iv_index_tbl_newsize()

static uint32_t iv_index_tbl_newsize ( struct ivar_update ivup)
static

◆ ivar_cache()

static VALUE ivar_cache ( VALUE  obj,
VALUE  name 
)
static

◆ ivar_i()

static int ivar_i ( st_data_t  k,
st_data_t  v,
st_data_t  a 
)
static

Definition at line 1652 of file variable.c.

References ID2SYM, key, rb_ary_push(), rb_is_instance_id(), and ST_CONTINUE.

Referenced by rb_obj_instance_variables().

◆ list_i()

static int list_i ( st_data_t  key,
st_data_t  value,
VALUE  ary 
)
static

Definition at line 2483 of file variable.c.

References ID2SYM, rb_ary_push(), RB_CONST_PUBLIC_P, ST_CONTINUE, and sym.

Referenced by rb_const_list().

◆ make_temporary_path()

static VALUE make_temporary_path ( VALUE  obj,
VALUE  klass 
)
static

Definition at line 238 of file variable.c.

References OBJ_FREEZE, fc_result::path, PRIsVALUE, Qfalse, Qnil, and rb_sprintf().

Referenced by ivar_cache(), and null_cache().

◆ mark_global_entry()

static enum rb_id_table_iterator_result mark_global_entry ( VALUE  v,
void *  ignored 
)
static

◆ mod_cvar_at()

static void* mod_cvar_at ( VALUE  mod,
void *  data 
)
static

Definition at line 3001 of file variable.c.

References cv_i(), RCLASS_IV_TBL, st_data_t, st_foreach_safe(), and st_init_numtable.

Referenced by mod_cvar_of(), and rb_mod_class_variables().

◆ mod_cvar_of()

static void* mod_cvar_of ( VALUE  mod,
void *  data 
)
static

Definition at line 3014 of file variable.c.

References mod, mod_cvar_at(), and RCLASS_SUPER.

Referenced by rb_mod_class_variables().

◆ never_cache()

static VALUE never_cache ( VALUE  obj,
VALUE  name 
)
static

Definition at line 330 of file variable.c.

References name.

Referenced by rb_search_class_path().

◆ NORETURN()

NORETURN ( static void   uninitialized_constantVALUE, VALUE)

◆ null_cache()

static VALUE null_cache ( VALUE  obj,
VALUE  name 
)
static

Definition at line 303 of file variable.c.

References make_temporary_path().

Referenced by rb_class_path_no_cache().

◆ obj_ivar_each()

static void obj_ivar_each ( VALUE  obj,
int(*)(ANYARGS func,
st_data_t  arg 
)
static

◆ obj_ivar_i()

static int obj_ivar_i ( st_data_t  key,
st_data_t  index,
st_data_t  arg 
)
static

◆ original_module()

static VALUE original_module ( VALUE  c)
static

Definition at line 2850 of file variable.c.

References RB_TYPE_P, RBASIC, and T_ICLASS.

Referenced by rb_cvar_get(), and rb_cvar_set().

◆ rb_alias_variable()

void rb_alias_variable ( ID  name1,
ID  name2 
)

◆ rb_attr_delete()

VALUE rb_attr_delete ( VALUE  obj,
ID  id 
)

Definition at line 1315 of file variable.c.

References Qnil, and rb_ivar_delete().

◆ rb_attr_get()

VALUE rb_attr_get ( VALUE  obj,
ID  id 
)

Definition at line 1273 of file variable.c.

References Qnil, and rb_ivar_lookup().

Referenced by adjust_backtrace_in_eval(), append_method(), call_verify_certificate_identity(), ecerr_destination_encoding(), ecerr_destination_encoding_name(), ecerr_error_bytes(), ecerr_error_char(), ecerr_incomplete_input(), ecerr_readagain_bytes(), ecerr_source_encoding(), ecerr_source_encoding_name(), exc_backtrace(), exc_backtrace_locations(), exc_cause(), exc_equal(), exc_setup_cause(), exc_to_s(), exit_status(), exit_success_p(), gzfile_error_inspect(), ignore_closed_stream(), inspect_enumerator(), lazy_init_yielder(), lazy_zip_arrays_func(), lazy_zip_func(), loop_stop(), mustbe_callable(), name_err_local_variables(), name_err_name(), name_err_receiver(), nometh_err_args(), nometh_err_private_call_p(), ossl_asn1_get_asn1type(), ossl_call_client_cert_cb(), ossl_call_session_remove_cb(), ossl_cipher_is_authenticated(), ossl_cipher_update(), ossl_ssl_initialize(), ossl_ssl_read_internal(), ossl_ssl_setup(), ossl_ssl_verify_callback(), ossl_ssl_write_internal(), ossl_sslctx_add_extra_chain_cert_i(), ossl_sslctx_setup(), ossl_start_ssl(), ossl_x509attr_set_value(), private_iv_get(), process_options(), pst_pid(), rb_error_frozen_object(), rb_mod_refine(), rb_mod_to_s(), rb_refinement_module_get_refined_class(), rb_singleton_class_has_metaclass_p(), rb_singleton_class_internal_p(), rb_syntax_error_append(), readline_attempted_completion_function(), readline_s_get_completion_case_fold(), readline_s_get_completion_proc(), readline_s_set_output(), reg_compile_gen(), ruby_th_dtrace_setup(), setup_exception(), sliceafter_i(), slicebefore_i(), slicewhen_i(), sockopt_data(), sockopt_family_m(), sockopt_level(), sockopt_optname(), ssl_renegotiation_cb(), stop_result(), struct_ivar_get(), syserr_eqq(), syserr_errno(), uncaught_throw_to_s(), used_modules_i(), using_module_recursive(), vm_call0_body(), vm_getivar(), and writer().

◆ rb_autoload()

void rb_autoload ( VALUE  mod,
ID  id,
const char *  file 
)

Definition at line 1933 of file variable.c.

References rb_autoload_str(), rb_eArgError, rb_fstring_cstr(), and rb_raise().

◆ rb_autoload_load()

VALUE rb_autoload_load ( VALUE  mod,
ID  id 
)

◆ rb_autoload_p()

VALUE rb_autoload_p ( VALUE  mod,
ID  id 
)

◆ rb_autoload_str()

void rb_autoload_str ( VALUE  mod,
ID  id,
VALUE  file 
)

◆ rb_autoloading_value()

int rb_autoloading_value ( VALUE  mod,
ID  id,
VALUE value 
)

◆ rb_class2name()

const char* rb_class2name ( VALUE  klass)

◆ rb_class_ivar_set()

int rb_class_ivar_set ( VALUE  obj,
ID  key,
VALUE  value 
)

◆ rb_class_name()

VALUE rb_class_name ( VALUE  klass)

◆ rb_class_path()

VALUE rb_class_path ( VALUE  klass)

◆ rb_class_path_cached()

VALUE rb_class_path_cached ( VALUE  klass)

Definition at line 318 of file variable.c.

References classpath, Qnil, RCLASS_IV_TBL, st_data_t, st_lookup, and tmp_classpath.

Referenced by newobj_i(), rb_const_set(), and rb_raw_obj_info().

◆ rb_class_path_no_cache()

VALUE rb_class_path_no_cache ( VALUE  klass)

◆ rb_const_defined()

int rb_const_defined ( VALUE  klass,
ID  id 
)

◆ rb_const_defined_0()

static int rb_const_defined_0 ( VALUE  klass,
ID  id,
int  exclude,
int  recurse,
int  visibility 
)
static

◆ rb_const_defined_at()

int rb_const_defined_at ( VALUE  klass,
ID  id 
)

◆ rb_const_defined_from()

int rb_const_defined_from ( VALUE  klass,
ID  id 
)

Definition at line 2574 of file variable.c.

References FALSE, rb_const_defined_0(), and TRUE.

◆ rb_const_get()

VALUE rb_const_get ( VALUE  klass,
ID  id 
)

◆ rb_const_get_0()

static VALUE rb_const_get_0 ( VALUE  klass,
ID  id,
int  exclude,
int  recurse,
int  visibility 
)
static

◆ rb_const_get_at()

VALUE rb_const_get_at ( VALUE  klass,
ID  id 
)

◆ rb_const_get_from()

VALUE rb_const_get_from ( VALUE  klass,
ID  id 
)

Definition at line 2329 of file variable.c.

References FALSE, rb_const_get_0(), and TRUE.

◆ rb_const_list()

VALUE rb_const_list ( void *  data)

◆ rb_const_lookup()

rb_const_entry_t* rb_const_lookup ( VALUE  klass,
ID  id 
)

◆ rb_const_missing()

VALUE rb_const_missing ( VALUE  klass,
VALUE  name 
)

Definition at line 1794 of file variable.c.

References rb_funcallv, rb_intern, and rb_vm_inc_const_missing_count().

Referenced by rb_const_get_0(), and rb_mod_const_get().

◆ rb_const_remove()

VALUE rb_const_remove ( VALUE  mod,
ID  id 
)

◆ rb_const_search()

static VALUE rb_const_search ( VALUE  klass,
ID  id,
int  exclude,
int  recurse,
int  visibility 
)
static

◆ rb_const_set()

void rb_const_set ( VALUE  klass,
ID  id,
VALUE  val 
)

◆ rb_const_warn_if_deprecated()

void rb_const_warn_if_deprecated ( const rb_const_entry_t ce,
VALUE  klass,
ID  id 
)

Definition at line 2263 of file variable.c.

References PRIsVALUE, QUOTE_ID, rb_class_name(), rb_cObject, RB_CONST_DEPRECATED_P, and rb_warn().

Referenced by rb_const_search(), and vm_get_ev_const().

◆ rb_copy_generic_ivar()

void rb_copy_generic_ivar ( VALUE  clone,
VALUE  obj 
)

◆ rb_cv_get()

VALUE rb_cv_get ( VALUE  klass,
const char *  name 
)

Definition at line 2975 of file variable.c.

References cv_intern(), and rb_cvar_get().

◆ rb_cv_set()

void rb_cv_set ( VALUE  klass,
const char *  name,
VALUE  val 
)

Definition at line 2968 of file variable.c.

References cv_intern(), and rb_cvar_set().

◆ rb_cvar_defined()

VALUE rb_cvar_defined ( VALUE  klass,
ID  id 
)

Definition at line 2949 of file variable.c.

References CVAR_LOOKUP, Qfalse, and Qtrue.

Referenced by rb_mod_cvar_defined(), rb_mod_remove_cvar(), and vm_defined().

◆ rb_cvar_get()

VALUE rb_cvar_get ( VALUE  klass,
ID  id 
)

◆ rb_cvar_set()

void rb_cvar_set ( VALUE  klass,
ID  id,
VALUE  val 
)

◆ rb_define_class_variable()

void rb_define_class_variable ( VALUE  klass,
const char *  name,
VALUE  val 
)

Definition at line 2982 of file variable.c.

References cv_intern(), and rb_cvar_set().

◆ rb_define_const()

void rb_define_const ( VALUE  klass,
const char *  name,
VALUE  val 
)

◆ rb_define_global_const()

void rb_define_global_const ( const char *  name,
VALUE  val 
)

◆ rb_define_hooked_variable()

void rb_define_hooked_variable ( const char *  name,
VALUE var,
VALUE(*)(ANYARGS getter,
void(*)(ANYARGS setter 
)

◆ rb_define_readonly_variable()

void rb_define_readonly_variable ( const char *  name,
const VALUE var 
)

Definition at line 641 of file variable.c.

References rb_define_hooked_variable(), and rb_gvar_readonly_setter().

Referenced by Init_IO().

◆ rb_define_variable()

void rb_define_variable ( const char *  name,
VALUE var 
)

Definition at line 635 of file variable.c.

References rb_define_hooked_variable().

Referenced by Init_IO(), and ruby_prog_init().

◆ rb_define_virtual_variable()

void rb_define_virtual_variable ( const char *  name,
VALUE(*)(ANYARGS getter,
void(*)(ANYARGS setter 
)

◆ rb_deprecate_constant()

void rb_deprecate_constant ( VALUE  mod,
const char *  name 
)

◆ rb_f_global_variables()

VALUE rb_f_global_variables ( void  )

◆ rb_f_trace_var()

VALUE rb_f_trace_var ( int  argc,
const VALUE argv 
)

◆ rb_f_untrace_var()

VALUE rb_f_untrace_var ( int  argc,
const VALUE argv 
)

◆ rb_free_generic_ivar()

void rb_free_generic_ivar ( VALUE  obj)

Definition at line 1183 of file variable.c.

References key, RUBY_FUNC_EXPORTED, st_data_t, st_delete, st_free_table, and xfree().

Referenced by obj_free(), and rb_copy_generic_ivar().

◆ rb_gc_mark_global_tbl()

void rb_gc_mark_global_tbl ( void  )

Definition at line 593 of file variable.c.

References mark_global_entry(), rb_global_tbl, and rb_id_table_foreach_values().

Referenced by gc_mark_roots().

◆ rb_generic_ivar_memsize()

RUBY_FUNC_EXPORTED size_t rb_generic_ivar_memsize ( VALUE  obj)

Definition at line 1200 of file variable.c.

References gen_ivtbl_bytes(), gen_ivtbl_get(), and gen_ivtbl::numiv.

Referenced by obj_memsize_of().

◆ rb_generic_ivar_table()

st_table* rb_generic_ivar_table ( VALUE  obj)

◆ rb_global_entry()

◆ rb_gv_get()

VALUE rb_gv_get ( const char *  name)

Definition at line 850 of file variable.c.

References global_id(), rb_global_entry(), and rb_gvar_get().

Referenced by mSyslog_open().

◆ rb_gv_set()

VALUE rb_gv_set ( const char *  name,
VALUE  val 
)

Definition at line 841 of file variable.c.

References global_id(), rb_global_entry(), and rb_gvar_set().

Referenced by process_sflag().

◆ rb_gvar_defined()

VALUE rb_gvar_defined ( struct rb_global_entry entry)

Definition at line 859 of file variable.c.

References rb_global_variable::getter, Qfalse, Qtrue, rb_gvar_undef_getter(), and rb_global_entry::var.

Referenced by vm_defined().

◆ rb_gvar_get()

VALUE rb_gvar_get ( struct rb_global_entry entry)

◆ rb_gvar_readonly_setter()

void rb_gvar_readonly_setter ( VALUE  v,
ID  id,
void *  d,
struct rb_global_variable g 
)

◆ rb_gvar_set()

VALUE rb_gvar_set ( struct rb_global_entry entry,
VALUE  val 
)

◆ rb_gvar_undef_getter()

VALUE rb_gvar_undef_getter ( ID  id,
void *  data,
struct rb_global_variable var 
)

Definition at line 509 of file variable.c.

References PRIsVALUE, Qnil, QUOTE_ID, and rb_warning().

Referenced by rb_global_entry(), and rb_gvar_defined().

◆ rb_gvar_undef_marker()

void rb_gvar_undef_marker ( VALUE var)

Definition at line 527 of file variable.c.

Referenced by rb_global_entry().

◆ rb_gvar_undef_setter()

void rb_gvar_undef_setter ( VALUE  val,
ID  id,
void *  d,
struct rb_global_variable var 
)

◆ rb_gvar_val_getter()

VALUE rb_gvar_val_getter ( ID  id,
void *  data,
struct rb_global_variable var 
)

Definition at line 532 of file variable.c.

Referenced by rb_define_virtual_variable(), and rb_gvar_undef_setter().

◆ rb_gvar_val_marker()

void rb_gvar_val_marker ( VALUE var)

Definition at line 544 of file variable.c.

References rb_gc_mark_maybe().

Referenced by rb_gvar_undef_setter().

◆ rb_gvar_val_setter()

void rb_gvar_val_setter ( VALUE  val,
ID  id,
void *  data,
struct rb_global_variable var 
)

Definition at line 538 of file variable.c.

References rb_global_variable::data.

Referenced by rb_gvar_undef_setter().

◆ rb_gvar_var_getter()

VALUE rb_gvar_var_getter ( ID  id,
void *  data,
struct rb_global_variable gvar 
)

Definition at line 551 of file variable.c.

References Qnil, and rb_global_entry::var.

Referenced by rb_define_hooked_variable().

◆ rb_gvar_var_marker()

void rb_gvar_var_marker ( VALUE var)

Definition at line 565 of file variable.c.

References rb_gc_mark_maybe().

Referenced by rb_define_hooked_variable().

◆ rb_gvar_var_setter()

void rb_gvar_var_setter ( VALUE  val,
ID  id,
void *  data,
struct rb_global_variable g 
)

Definition at line 559 of file variable.c.

Referenced by rb_define_hooked_variable().

◆ rb_iv_get()

VALUE rb_iv_get ( VALUE  obj,
const char *  name 
)

◆ rb_iv_set()

VALUE rb_iv_set ( VALUE  obj,
const char *  name,
VALUE  val 
)

◆ rb_ivar_count()

st_index_t rb_ivar_count ( VALUE  obj)

◆ rb_ivar_defined()

VALUE rb_ivar_defined ( VALUE  obj,
ID  id 
)

◆ rb_ivar_delete()

static VALUE rb_ivar_delete ( VALUE  obj,
ID  id,
VALUE  undef 
)
static

◆ rb_ivar_foreach()

void rb_ivar_foreach ( VALUE  obj,
int(*)(ANYARGS func,
st_data_t  arg 
)

◆ rb_ivar_get()

VALUE rb_ivar_get ( VALUE  obj,
ID  id 
)

◆ rb_ivar_lookup()

VALUE rb_ivar_lookup ( VALUE  obj,
ID  id,
VALUE  undef 
)

◆ rb_ivar_set()

VALUE rb_ivar_set ( VALUE  obj,
ID  id,
VALUE  val 
)

Definition at line 1364 of file variable.c.

References ALLOC_N, BUILTIN_TYPE, generic_ivar_set(), ivar_update::index, ivar_update::iv_extended, ivar_update::iv_index_tbl, iv_index_tbl_extend(), iv_index_tbl_make(), iv_index_tbl_newsize(), len, MEMCPY, Qundef, rb_check_frozen, rb_class_ivar_set(), RB_OBJ_WRITE, RBASIC, RCLASS_IV_TBL, REALLOC_N, ROBJECT, ROBJECT_EMBED, ROBJECT_EMBED_LEN_MAX, ROBJECT_IVPTR, ROBJECT_NUMIV, st_init_numtable, T_CLASS, T_MODULE, T_OBJECT, ivar_update::u, and val.

Referenced by add_event_call_back(), adjust_backtrace_in_eval(), copy_ivar_i(), create_win32ole_param(), create_win32ole_variable(), cState_aset(), enc_set_index(), enum_chunk(), enum_chunk_while(), enum_slice_after(), enum_slice_before(), enum_slice_when(), enumerable_lazy(), esignal_init(), exc_initialize(), exc_set_backtrace(), exc_setup_cause(), exit_initialize(), fev_initialize(), fev_set_handler(), gzfile_raise(), initialize(), initialize_params(), int_ossl_asn1_decode0_prim(), iseq_compile_each(), ivar_cache(), lazy_init_block(), lazy_initialize(), lazy_set_args(), lazy_zip_arrays_func(), lazy_zip_func(), make_econv_exception(), mustbe_callable(), name_err_initialize(), name_err_local_variables(), next_i(), nometh_err_initialize(), nucomp_marshal_load(), nurat_marshal_load(), olemethod_set_member(), oleparam_ole_param_from_index(), olerecord_set_ivar(), oletype_set_member(), ossl_cipher_init(), ossl_cipher_is_authenticated(), ossl_cipher_pkcs5_keyivgen(), ossl_cipher_set_key(), ossl_ssl_initialize(), ossl_ssl_set_session(), ossl_ssl_verify_callback(), ossl_sslctx_add_extra_chain_cert_i(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_setup(), ossl_start_ssl(), ossl_tmp_dh_callback(), parse_main(), pipe_open(), process_options(), r_ivar(), raise_argument_error(), raise_loaderror(), range_dumper(), rb_const_set(), rb_inflate_s_allocate(), rb_io_init_copy(), rb_iv_set(), rb_last_status_set(), rb_mod_refine(), rb_name_class(), rb_name_err_new(), rb_obj_ivar_set(), rb_set_class_path(), rb_set_class_path_string(), rb_threadptr_setup_exception(), readline_s_get_completion_proc(), readline_s_set_completion_case_fold(), readline_s_set_completion_proc(), readline_s_set_output(), ruby_init_loadpath_safe(), ruby_thread_init(), set_strpath(), setup_exception(), sockopt_initialize(), ssl_renegotiation_cb(), str_associate(), struct_ivar_get(), struct_set_members(), syserr_initialize(), time_mdump(), time_mload(), uncaught_throw_init(), vm_call0_body(), and vm_setivar().

◆ rb_local_constants()

static VALUE rb_local_constants ( VALUE  mod)
static

◆ rb_local_constants_i()

static enum rb_id_table_iterator_result rb_local_constants_i ( ID  const_name,
VALUE  const_value,
void *  ary 
)
static

Definition at line 2435 of file variable.c.

References ID2SYM, ID_TABLE_CONTINUE, rb_ary_push(), RB_CONST_PRIVATE_P, and rb_is_const_id().

Referenced by rb_local_constants().

◆ rb_mark_generic_ivar()

void rb_mark_generic_ivar ( VALUE  obj)

Definition at line 1173 of file variable.c.

References gen_ivtbl_get(), and gen_ivtbl_mark().

Referenced by gc_mark_children().

◆ rb_mod_class_variables()

VALUE rb_mod_class_variables ( int  argc,
const VALUE argv,
VALUE  mod 
)

Definition at line 3068 of file variable.c.

References cvar_list(), mod_cvar_at(), mod_cvar_of(), Qtrue, rb_scan_args(), and RTEST.

Referenced by InitVM_Object().

◆ rb_mod_const_at()

void* rb_mod_const_at ( VALUE  mod,
void *  data 
)

Definition at line 2457 of file variable.c.

References rb_id_table_foreach(), RCLASS_CONST_TBL, st_init_numtable, and sv_i().

Referenced by rb_mod_const_of(), and rb_mod_s_constants().

◆ rb_mod_const_missing()

VALUE rb_mod_const_missing ( VALUE  klass,
VALUE  name 
)

Definition at line 1839 of file variable.c.

References rb_vm_pop_cfunc_frame(), uninitialized_constant(), and UNREACHABLE.

Referenced by InitVM_Object(), and rb_mod_const_get().

◆ rb_mod_const_of()

void* rb_mod_const_of ( VALUE  mod,
void *  data 
)

Definition at line 2470 of file variable.c.

References mod, rb_cObject, rb_mod_const_at(), and RCLASS_SUPER.

Referenced by rb_mod_constants(), and rb_mod_s_constants().

◆ rb_mod_constants()

VALUE rb_mod_constants ( int  argc,
const VALUE argv,
VALUE  mod 
)

◆ rb_mod_deprecate_constant()

VALUE rb_mod_deprecate_constant ( int  argc,
const VALUE argv,
VALUE  obj 
)

Definition at line 2843 of file variable.c.

References CONST_DEPRECATED, and set_const_visibility().

Referenced by InitVM_Object().

◆ rb_mod_name()

VALUE rb_mod_name ( VALUE  mod)

Definition at line 228 of file variable.c.

References classname(), NIL_P, fc_result::path, and rb_str_dup().

Referenced by InitVM_Object().

◆ rb_mod_private_constant()

VALUE rb_mod_private_constant ( int  argc,
const VALUE argv,
VALUE  obj 
)

Definition at line 2815 of file variable.c.

References CONST_PRIVATE, CONST_VISIBILITY_MASK, and set_const_visibility().

Referenced by InitVM_Object().

◆ rb_mod_public_constant()

VALUE rb_mod_public_constant ( int  argc,
const VALUE argv,
VALUE  obj 
)

Definition at line 2829 of file variable.c.

References CONST_PUBLIC, CONST_VISIBILITY_MASK, and set_const_visibility().

Referenced by InitVM_Object().

◆ rb_mod_remove_const()

VALUE rb_mod_remove_const ( VALUE  mod,
VALUE  name 
)

Definition at line 2375 of file variable.c.

References id_for_var, rb_const_remove(), and rb_name_err_raise.

Referenced by InitVM_Object(), and new_struct().

◆ rb_mod_remove_cvar()

VALUE rb_mod_remove_cvar ( VALUE  mod,
VALUE  name 
)

◆ rb_name_class()

void rb_name_class ( VALUE  klass,
ID  id 
)

Definition at line 437 of file variable.c.

References classid, ID2SYM, and rb_ivar_set().

Referenced by boot_defclass(), rb_const_set(), rb_define_class(), and rb_define_module_id().

◆ rb_obj_classname()

const char* rb_obj_classname ( VALUE  obj)

◆ rb_obj_instance_variables()

VALUE rb_obj_instance_variables ( VALUE  obj)

Definition at line 1681 of file variable.c.

References ivar_i(), rb_ary_new(), and rb_ivar_foreach().

◆ rb_obj_remove_instance_variable()

VALUE rb_obj_remove_instance_variable ( VALUE  obj,
VALUE  name 
)

◆ rb_path2class()

VALUE rb_path2class ( const char *  path)

◆ rb_path_to_class()

VALUE rb_path_to_class ( VALUE  pathname)

◆ rb_public_const_defined()

int rb_public_const_defined ( VALUE  klass,
ID  id 
)

Definition at line 2598 of file variable.c.

References FALSE, rb_const_defined_0(), and TRUE.

◆ rb_public_const_defined_at()

int rb_public_const_defined_at ( VALUE  klass,
ID  id 
)

Definition at line 2604 of file variable.c.

References FALSE, rb_const_defined_0(), and TRUE.

◆ rb_public_const_defined_from()

int rb_public_const_defined_from ( VALUE  klass,
ID  id 
)

Definition at line 2592 of file variable.c.

References rb_const_defined_0(), and TRUE.

Referenced by vm_get_ev_const().

◆ rb_public_const_get()

VALUE rb_public_const_get ( VALUE  klass,
ID  id 
)

Definition at line 2353 of file variable.c.

References FALSE, rb_const_get_0(), and TRUE.

◆ rb_public_const_get_at()

VALUE rb_public_const_get_at ( VALUE  klass,
ID  id 
)

Definition at line 2359 of file variable.c.

References FALSE, rb_const_get_0(), and TRUE.

◆ rb_public_const_get_from()

VALUE rb_public_const_get_from ( VALUE  klass,
ID  id 
)

Definition at line 2347 of file variable.c.

References rb_const_get_0(), and TRUE.

Referenced by vm_get_ev_const().

◆ rb_search_class_path()

VALUE rb_search_class_path ( VALUE  klass)

Definition at line 336 of file variable.c.

References never_cache(), and rb_tmp_class_path().

Referenced by ignored_block(), and rb_vm_bugreport().

◆ rb_set_class_path()

void rb_set_class_path ( VALUE  klass,
VALUE  under,
const char *  name 
)

◆ rb_set_class_path_string()

void rb_set_class_path_string ( VALUE  klass,
VALUE  under,
VALUE  name 
)

◆ rb_st_copy()

st_table* rb_st_copy ( VALUE  obj,
struct st_table orig_tbl 
)

Definition at line 3163 of file variable.c.

References st_copy, st_data_t, st_foreach, and tbl_copy_i().

Referenced by rb_mod_init_copy(), and rb_singleton_class_clone_and_attach().

◆ rb_tmp_class_path()

static VALUE rb_tmp_class_path ( VALUE  klass,
int *  permanent,
path_cache_func  cache_path 
)
static

◆ rb_trace_eval()

static void rb_trace_eval ( VALUE  cmd,
VALUE  val 
)
static

Definition at line 658 of file variable.c.

References rb_ary_new3, and rb_eval_cmd().

Referenced by rb_f_trace_var().

◆ remove_trace()

static void remove_trace ( struct rb_global_variable var)
static

Definition at line 714 of file variable.c.

References trace_var::next, trace_var::removed, rb_global_variable::trace, and xfree().

Referenced by rb_f_untrace_var(), and trace_en().

◆ reset_safe()

static VALUE reset_safe ( VALUE  safe)
static

Definition at line 2015 of file variable.c.

References rb_set_safe_level_force().

Referenced by autoload_reset(), and check_autoload_required().

◆ set_const_visibility()

static void set_const_visibility ( VALUE  mod,
int  argc,
const VALUE argv,
rb_const_flag_t  flag,
rb_const_flag_t  mask 
)
static

◆ setup_const_entry()

static void setup_const_entry ( rb_const_entry_t ce,
VALUE  klass,
VALUE  val,
rb_const_flag_t  visibility 
)
static

◆ sv_i()

static enum rb_id_table_iterator_result sv_i ( ID  key,
VALUE  v,
void *  a 
)
static

Definition at line 2423 of file variable.c.

References cv_i_update(), ID_TABLE_CONTINUE, rb_is_const_id(), st_data_t, and st_update().

Referenced by rb_mod_const_at().

◆ tbl_copy_i()

static int tbl_copy_i ( st_data_t  key,
st_data_t  value,
st_data_t  data 
)
static

Definition at line 3156 of file variable.c.

References Qundef, RB_OBJ_WRITTEN, and ST_CONTINUE.

Referenced by rb_st_copy().

◆ trace_en()

static VALUE trace_en ( struct rb_global_variable var)
static

Definition at line 816 of file variable.c.

References rb_global_variable::block_trace, Qnil, and remove_trace().

Referenced by rb_gvar_set().

◆ trace_ev()

static VALUE trace_ev ( struct trace_data data)
static

Definition at line 803 of file variable.c.

References trace_var::data, trace_var::func, trace_var::next, Qnil, trace_data::trace, and trace_data::val.

Referenced by rb_gvar_set().

◆ uninitialized_constant()

static void uninitialized_constant ( VALUE  klass,
VALUE  name 
)
static

Definition at line 1783 of file variable.c.

References rb_class_real(), rb_cObject, and rb_name_err_raise.

Referenced by rb_mod_const_missing(), and rb_obj_remove_instance_variable().

Variable Documentation

◆ autoload

ID autoload
static

Definition at line 24 of file variable.c.

Referenced by autoload_data(), autoload_delete(), Init_var_tables(), and rb_autoload_str().

◆ autoload_data_i_type

const rb_data_type_t autoload_data_i_type
static
Initial value:
= {
"autoload_i",
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
static void autoload_i_mark(void *ptr)
Definition: variable.c:1910
static size_t autoload_i_memsize(const void *ptr)
Definition: variable.c:1918
#define RUBY_TYPED_DEFAULT_FREE
Definition: ruby.h:1141

Definition at line 1923 of file variable.c.

◆ autoload_data_type

const rb_data_type_t autoload_data_type
static
Initial value:
= {
"autoload",
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
static void autoload_free(void *ptr)
Definition: variable.c:1854
static size_t autoload_memsize(const void *ptr)
Definition: variable.c:1860
static void autoload_mark(void *ptr)
Definition: variable.c:1848

Definition at line 1866 of file variable.c.

◆ classid

ID classid
static

◆ classpath

ID classpath
static

◆ generic_iv_tbl

st_table* generic_iv_tbl
static

Definition at line 29 of file variable.c.

◆ generic_iv_tbl_compat

st_table* generic_iv_tbl_compat
static

Definition at line 30 of file variable.c.

◆ rb_global_tbl

struct rb_id_table* rb_global_tbl

◆ tmp_classpath

ID tmp_classpath
static