Ruby: internal/variable.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
variable.h File Reference

Internal header for variables. More...

`#include "ruby/internal/config.h"`
`#include <stddef.h>`
`#include "constant.h"`
`#include "ruby/internal/stdbool.h"`
`#include "ruby/ruby.h"`

Go to the source code of this file.

## Macros
#define | ROBJECT_TRANSIENT_FLAG FL_USER13

## Functions
void | rb_gc_mark_global_tbl (void)
void | rb_gc_update_global_tbl (void)
size_t | rb_generic_ivar_memsize (VALUE)
VALUE | rb_search_class_path (VALUE)
VALUE | rb_attr_delete (VALUE, ID)
VALUE | rb_ivar_lookup (VALUE obj, ID id, VALUE undef)
void | rb_autoload_str (VALUE mod, ID id, VALUE file)
VALUE | rb_autoload_at_p (VALUE, ID, int)
VALUE | rb_mod_const_missing (VALUE, VALUE)
rb_gvar_getter_t * | rb_gvar_getter_function_of (ID)
rb_gvar_setter_t * | rb_gvar_setter_function_of (ID)
void | rb_gvar_readonly_setter (VALUE v, ID id, VALUE *_)
void | rb_gvar_ractor_local (const char *name)
void | rb_mark_generic_ivar (VALUE)
void | rb_mv_generic_ivar (VALUE src, VALUE dst)
VALUE | rb_const_missing (VALUE klass, VALUE name)
int | rb_class_ivar_set (VALUE klass, ID vid, VALUE value)
void | rb_iv_tbl_copy (VALUE dst, VALUE src)
void | rb_deprecate_constant (VALUE mod, const char *name)
VALUE | rb_gvar_get (ID)
VALUE | rb_gvar_set (ID, VALUE)
VALUE | rb_gvar_defined (ID)
void | rb_const_warn_if_deprecated (const rb_const_entry_t *, VALUE, ID)
void | rb_init_iv_list (VALUE obj)

## Detailed Description

Internal header for variables.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Definition in file variable.h.

## Macro Definition Documentation

## ◆ ROBJECT_TRANSIENT_FLAG

#define ROBJECT_TRANSIENT_FLAG FL_USER13

Definition at line 20 of file variable.h.

## Function Documentation

## ◆ rb_attr_delete()

VALUE rb_attr_delete | ( | VALUE | obj,
|  | ID | id
| ) |  |

Definition at line 1287 of file variable.c.

References Qnil.

## ◆ rb_autoload_at_p()

VALUE rb_autoload_at_p | ( | VALUE | mod,
|  | ID | id,
|  | int | recur
| ) |  |

Definition at line 2517 of file variable.c.

References autoload_data_i::feature, load(), mod, Qnil, RCLASS_SUPER, and recur.

Referenced by rb_autoload_p().

## ◆ rb_autoload_str()

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

Definition at line 2158 of file variable.c.

References autoload_const::ad, check_autoload_table, autoload_const::cnode, CONST_PUBLIC, autoload_data_i::constants, DATA_PTR, autoload_data_i::feature, autoload_const::flag, id, autoload_const::id, mod, autoload_const::mod, NIL_P, PRIsVALUE, Qnil, Qundef, rb_check_typeddata(), rb_const_lookup(), rb_const_set(), rb_eArgError, rb_eNameError, rb_fstring(), rb_gc_register_mark_object(), rb_hash_aref(), rb_hash_aset(), rb_ident_hash_new(), rb_is_const_id(), rb_obj_hide(), RB_OBJ_WRITTEN, rb_raise(), RCLASS_IV_TBL, RSTRING_LEN, st_add_direct, st_init_numtable, st_insert, st_lookup, autoload_data_i::state, T_STRING, TypedData_Make_Struct, TypedData_Wrap_Struct, rb_const_entry_struct::value, and autoload_const::value.

Referenced by rb_autoload().

## ◆ rb_class_ivar_set()

int rb_class_ivar_set | ( | VALUE | klass,
|  | ID | vid,
|  | VALUE | value
| ) |  |

Definition at line 3589 of file variable.c.

References key, Qundef, RB_OBJ_WRITTEN, RCLASS_IV_TBL, and st_insert.

Referenced by rb_cvar_set(), and rb_singleton_class_attached().

## ◆ rb_const_missing()

VALUE rb_const_missing | ( | VALUE | klass,
|  | VALUE | name
| ) |  |

Definition at line 1915 of file variable.c.

References name, rb_funcallv, and rb_vm_inc_const_missing_count().

## ◆ rb_const_warn_if_deprecated()

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

Definition at line 2533 of file variable.c.

References PRIsVALUE, rb_category_warn, rb_class_name(), rb_cObject, RB_CONST_DEPRECATED_P, RB_WARN_CATEGORY_DEPRECATED, and rb_warning_category_enabled_p().

## ◆ rb_deprecate_constant()

void rb_deprecate_constant | ( | VALUE | mod,
|  | const char * | name
| ) |  |

Definition at line 3217 of file variable.c.

References CONST_DEPRECATED, rb_const_entry_struct::flag, id, ID2SYM, len, mod, name, NULL, rb_check_id_cstr(), rb_class_modify_check(), rb_const_lookup(), rb_fstring_new(), and strlen().

## ◆ rb_gc_mark_global_tbl()

void rb_gc_mark_global_tbl | ( | void |  | ) |

Definition at line 497 of file variable.c.

References rb_id_table_foreach_values().

## ◆ rb_gc_update_global_tbl()

void rb_gc_update_global_tbl | ( | void |  | ) |

Definition at line 515 of file variable.c.

References rb_id_table_foreach_values().

## ◆ rb_generic_ivar_memsize()

size_t rb_generic_ivar_memsize | ( | VALUE | obj | ) |

Definition at line 1167 of file variable.c.

References gen_ivtbl::numiv.

## ◆ rb_gvar_defined()

VALUE rb_gvar_defined | ( | ID | id | ) |

Definition at line 781 of file variable.c.

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

## ◆ rb_gvar_get()

VALUE rb_gvar_get | ( | ID | id | ) |

Definition at line 760 of file variable.c.

References rb_global_variable::data, rb_global_variable::getter, rb_global_entry::id, and rb_global_entry::var.

Referenced by rb_gv_get().

## ◆ rb_gvar_getter_function_of()

rb_gvar_getter_t * rb_gvar_getter_function_of | ( | ID | id | ) |

Definition at line 789 of file variable.c.

References rb_global_variable::getter, and rb_global_entry::var.

## ◆ rb_gvar_ractor_local()

void rb_gvar_ractor_local | ( | const char * | name | ) |

Definition at line 359 of file variable.c.

References name, rb_global_entry::ractor_local, and rb_intern().

Referenced by Init_eval(), Init_IO(), Init_Regexp(), InitVM_process(), and ruby_prog_init().

## ◆ rb_gvar_readonly_setter()

void rb_gvar_readonly_setter | ( | VALUE | v,
|  | ID | id,
|  | VALUE * | _
| ) |  |

Definition at line 475 of file variable.c.

References PRIsVALUE, and rb_name_error().

## ◆ rb_gvar_set()

VALUE rb_gvar_set | ( | ID | id,
|  | VALUE | val
| ) |  |

Definition at line 745 of file variable.c.

Referenced by rb_gv_set().

## ◆ rb_gvar_setter_function_of()

rb_gvar_setter_t * rb_gvar_setter_function_of | ( | ID | id | ) |

Definition at line 796 of file variable.c.

References rb_global_variable::setter, and rb_global_entry::var.

## ◆ rb_init_iv_list()

void rb_init_iv_list | ( | VALUE | obj | ) |

Definition at line 1438 of file variable.c.

References len, st_table::num_entries, and ROBJECT_IV_INDEX_TBL.

## ◆ rb_iv_tbl_copy()

void rb_iv_tbl_copy | ( | VALUE | dst,
|  | VALUE | src
| ) |  |

Definition at line 3605 of file variable.c.

References RCLASS_IV_TBL, st_copy, and st_foreach.

Referenced by rb_singleton_class_clone_and_attach().

## ◆ rb_ivar_lookup()

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

Definition at line 1192 of file variable.c.

References BUILTIN_TYPE, FL_EXIVAR, FL_TEST, len, ptr, Qundef, RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, SPECIAL_CONST_P, st_lookup, T_CLASS, T_MODULE, and T_OBJECT.

Referenced by rb_attr_get(), rb_ivar_get(), and rb_memory_view_register().

## ◆ rb_mark_generic_ivar()

void rb_mark_generic_ivar | ( | VALUE | obj | ) |

Definition at line 1137 of file variable.c.

## ◆ rb_mod_const_missing()

VALUE rb_mod_const_missing | ( | VALUE | klass,
|  | VALUE | name
| ) |  |

Definition at line 1960 of file variable.c.

## ◆ rb_mv_generic_ivar()

void rb_mv_generic_ivar | ( | VALUE | src,
|  | VALUE | dst
| ) |  |

Definition at line 1147 of file variable.c.

References key, st_delete, and st_insert.

## ◆ rb_search_class_path()

VALUE rb_search_class_path | ( | VALUE | klass | ) |

Definition at line 191 of file variable.c.

Referenced by rb_vm_bugreport().