Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | Enumerations | Functions | Variables
symbol.c File Reference
#include "internal.h"
#include "ruby/st.h"
#include "symbol.h"
#include "gc.h"
#include "probes.h"
#include "id.c"
#include "id_table.c"
Include dependency graph for symbol.c:

Go to the source code of this file.

Data Structures

struct  symbols
 

Macros

#define SYMBOL_DEBUG   0
 
#define SYMBOL_PINNED_P(sym)   (RSYMBOL(sym)->id&~ID_SCOPE_MASK)
 
#define STATIC_SYM2ID(sym)   RSHIFT((unsigned long)(sym), RUBY_SPECIAL_SHIFT)
 
#define REGISTER_SYMID(id, name)   register_static_symid((id), (name), strlen(name), enc)
 
#define is_identchar(p, e, enc)   (ISALNUM((unsigned char)*(p)) || (*(p)) == '_' || !ISASCII(*(p)))
 
#define op_tbl_count   numberof(op_tbl)
 
#define op_tbl_len(i)   (!op_tbl[i].name[1] ? 1 : !op_tbl[i].name[2] ? 2 : 3)
 
#define IDSET_ATTRSET_FOR_SYNTAX   ((1U<<ID_LOCAL)|(1U<<ID_CONST))
 
#define IDSET_ATTRSET_FOR_INTERN   (~(~0U<<(1<<ID_SCOPE_SHIFT)) & ~(1U<<ID_ATTRSET))
 

Enumerations

enum  { ID_ENTRY_UNIT = 512 }
 
enum  id_entry_type { ID_ENTRY_STR, ID_ENTRY_SYM, ID_ENTRY_SIZE }
 

Functions

static ID register_static_symid (ID, const char *, long, rb_encoding *)
 
static ID register_static_symid_str (ID, VALUE)
 
 STATIC_ASSERT (op_tbl_name_size, sizeof(op_tbl[0].name)==3)
 
static void Init_op_tbl (void)
 
void Init_sym (void)
 
 WARN_UNUSED_RESULT (static VALUE dsymbol_alloc(const VALUE klass, const VALUE str, rb_encoding *const enc, const ID type))
 
 WARN_UNUSED_RESULT (static VALUE dsymbol_check(const VALUE sym))
 
 WARN_UNUSED_RESULT (static ID lookup_str_id(VALUE str))
 
 WARN_UNUSED_RESULT (static VALUE lookup_str_sym(const VALUE str))
 
 WARN_UNUSED_RESULT (static VALUE lookup_id_str(ID id))
 
 WARN_UNUSED_RESULT (static ID attrsetname_to_attr(VALUE name))
 
 WARN_UNUSED_RESULT (static ID intern_str(VALUE str, int mutable))
 
ID rb_id_attrset (ID id)
 
ID rb_id_attrget (ID id)
 
static int is_special_global_name (const char *m, const char *e, rb_encoding *enc)
 
int rb_symname_p (const char *name)
 
int rb_enc_symname_p (const char *name, rb_encoding *enc)
 
static int rb_enc_symname_type (const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset)
 
int rb_enc_symname2_p (const char *name, long len, rb_encoding *enc)
 
static int rb_str_symname_type (VALUE name, unsigned int allowed_attrset)
 
static void set_id_entry (rb_id_serial_t num, VALUE str, VALUE sym)
 
static VALUE get_id_entry (rb_id_serial_t num, const enum id_entry_type t)
 
static ID rb_id_serial_to_id (rb_id_serial_t num)
 
static void register_sym (VALUE str, VALUE sym)
 
static void unregister_sym (VALUE str, VALUE sym)
 
static int sym_check_asciionly (VALUE str)
 
static VALUE dsymbol_alloc (const VALUE klass, const VALUE str, rb_encoding *const enc, const ID type)
 
static VALUE dsymbol_check (const VALUE sym)
 
static ID lookup_str_id (VALUE str)
 
static VALUE lookup_str_sym (const VALUE str)
 
static VALUE lookup_id_str (ID id)
 
ID rb_intern3 (const char *name, long len, rb_encoding *enc)
 
static ID next_id_base (void)
 
static ID intern_str (VALUE str, int mutable)
 
ID rb_intern2 (const char *name, long len)
 
ID rb_intern (const char *name)
 
ID rb_intern_str (VALUE str)
 
void rb_gc_free_dsymbol (VALUE sym)
 
VALUE rb_str_intern (VALUE str)
 
ID rb_sym2id (VALUE sym)
 
VALUE rb_id2sym (ID x)
 
VALUE rb_sym2str (VALUE sym)
 
VALUE rb_id2str (ID id)
 
const char * rb_id2name (ID id)
 
ID rb_make_internal_id (void)
 
static int symbols_i (st_data_t key, st_data_t value, st_data_t arg)
 
VALUE rb_sym_all_symbols (void)
 
size_t rb_sym_immortal_count (void)
 
int rb_is_const_id (ID id)
 
int rb_is_class_id (ID id)
 
int rb_is_global_id (ID id)
 
int rb_is_instance_id (ID id)
 
int rb_is_attrset_id (ID id)
 
int rb_is_local_id (ID id)
 
int rb_is_junk_id (ID id)
 
int rb_is_const_sym (VALUE sym)
 
int rb_is_class_sym (VALUE sym)
 
int rb_is_global_sym (VALUE sym)
 
int rb_is_instance_sym (VALUE sym)
 
int rb_is_attrset_sym (VALUE sym)
 
int rb_is_local_sym (VALUE sym)
 
int rb_is_junk_sym (VALUE sym)
 
ID rb_check_id (volatile VALUE *namep)
 Returns ID for the given name if it is interned already, or 0. More...
 
VALUE rb_check_symbol (volatile VALUE *namep)
 
ID rb_check_id_cstr (const char *ptr, long len, rb_encoding *enc)
 
VALUE rb_check_symbol_cstr (const char *ptr, long len, rb_encoding *enc)
 
 FUNC_MINIMIZED (VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc))
 
 FUNC_MINIMIZED (VALUE rb_sym_intern_cstr(const char *ptr, rb_encoding *enc))
 
 FUNC_MINIMIZED (VALUE rb_sym_intern_ascii(const char *ptr, long len))
 
 FUNC_MINIMIZED (VALUE rb_sym_intern_ascii_cstr(const char *ptr))
 
VALUE rb_sym_intern (const char *ptr, long len, rb_encoding *enc)
 
VALUE rb_sym_intern_cstr (const char *ptr, rb_encoding *enc)
 
VALUE rb_sym_intern_ascii (const char *ptr, long len)
 
VALUE rb_sym_intern_ascii_cstr (const char *ptr)
 
static ID attrsetname_to_attr_id (VALUE name)
 
static ID attrsetname_to_attr (VALUE name)
 
int rb_is_const_name (VALUE name)
 
int rb_is_class_name (VALUE name)
 
int rb_is_global_name (VALUE name)
 
int rb_is_instance_name (VALUE name)
 
int rb_is_attrset_name (VALUE name)
 
int rb_is_local_name (VALUE name)
 
int rb_is_method_name (VALUE name)
 
int rb_is_junk_name (VALUE name)
 

Variables

static struct symbols global_symbols = {tNEXT_ID-1}
 
static const struct st_hash_type symhash
 

Macro Definition Documentation

◆ IDSET_ATTRSET_FOR_INTERN

#define IDSET_ATTRSET_FOR_INTERN   (~(~0U<<(1<<ID_SCOPE_SHIFT)) & ~(1U<<ID_ATTRSET))

Definition at line 202 of file symbol.c.

Referenced by intern_str(), rb_is_attrset_name(), and rb_str_intern().

◆ IDSET_ATTRSET_FOR_SYNTAX

#define IDSET_ATTRSET_FOR_SYNTAX   ((1U<<ID_LOCAL)|(1U<<ID_CONST))

Definition at line 201 of file symbol.c.

Referenced by rb_enc_symname2_p(), and rb_is_junk_name().

◆ is_identchar

#define is_identchar (   p,
  e,
  enc 
)    (ISALNUM((unsigned char)*(p)) || (*(p)) == '_' || !ISASCII(*(p)))

Definition at line 31 of file symbol.c.

Referenced by is_special_global_name(), and rb_enc_symname_type().

◆ op_tbl_count

#define op_tbl_count   numberof(op_tbl)

Definition at line 33 of file symbol.c.

Referenced by Init_op_tbl().

◆ op_tbl_len

#define op_tbl_len (   i)    (!op_tbl[i].name[1] ? 1 : !op_tbl[i].name[2] ? 2 : 3)

Definition at line 35 of file symbol.c.

Referenced by Init_op_tbl().

◆ REGISTER_SYMID

#define REGISTER_SYMID (   id,
  name 
)    register_static_symid((id), (name), strlen(name), enc)

Definition at line 28 of file symbol.c.

Referenced by Init_id().

◆ STATIC_SYM2ID

#define STATIC_SYM2ID (   sym)    RSHIFT((unsigned long)(sym), RUBY_SPECIAL_SHIFT)

Definition at line 24 of file symbol.c.

Referenced by lookup_str_id(), rb_check_id(), rb_sym2id(), and rb_sym2str().

◆ SYMBOL_DEBUG

#define SYMBOL_DEBUG   0

Definition at line 19 of file symbol.c.

◆ SYMBOL_PINNED_P

#define SYMBOL_PINNED_P (   sym)    (RSYMBOL(sym)->id&~ID_SCOPE_MASK)

Definition at line 22 of file symbol.c.

Referenced by rb_check_id(), rb_check_symbol(), and symbols_i().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ID_ENTRY_UNIT 

Definition at line 54 of file symbol.c.

◆ id_entry_type

Enumerator
ID_ENTRY_STR 
ID_ENTRY_SYM 
ID_ENTRY_SIZE 

Definition at line 56 of file symbol.c.

Function Documentation

◆ attrsetname_to_attr()

static ID attrsetname_to_attr ( VALUE  name)
static

Definition at line 1074 of file symbol.c.

References attrsetname_to_attr_id(), and rb_is_attrset_name().

Referenced by Init_sym(), and rb_id_attrget().

◆ attrsetname_to_attr_id()

static ID attrsetname_to_attr_id ( VALUE  name)
static

◆ dsymbol_alloc()

static VALUE dsymbol_alloc ( const VALUE  klass,
const VALUE  str,
rb_encoding *const  enc,
const ID  type 
)
static

◆ dsymbol_check()

static VALUE dsymbol_check ( const VALUE  sym)
inlinestatic

◆ FUNC_MINIMIZED() [1/4]

FUNC_MINIMIZED ( VALUE   rb_sym_internconst char *ptr, long len, rb_encoding *enc)

Referenced by rb_check_symbol_cstr().

◆ FUNC_MINIMIZED() [2/4]

FUNC_MINIMIZED ( VALUE   rb_sym_intern_cstrconst char *ptr, rb_encoding *enc)

◆ FUNC_MINIMIZED() [3/4]

FUNC_MINIMIZED ( VALUE   rb_sym_intern_asciiconst char *ptr, long len)

◆ FUNC_MINIMIZED() [4/4]

FUNC_MINIMIZED ( VALUE   rb_sym_intern_ascii_cstrconst char *ptr)

◆ get_id_entry()

static VALUE get_id_entry ( rb_id_serial_t  num,
const enum id_entry_type  t 
)
static

◆ Init_op_tbl()

static void Init_op_tbl ( void  )
static

Definition at line 38 of file symbol.c.

References ISALNUM, name, op_tbl, op_tbl_count, op_tbl_len, rb_usascii_encoding(), register_static_symid(), and token.

Referenced by Init_sym().

◆ Init_sym()

void Init_sym ( void  )

◆ intern_str()

static ID intern_str ( VALUE  str,
int  mutable 
)
static

◆ is_special_global_name()

static int is_special_global_name ( const char *  m,
const char *  e,
rb_encoding enc 
)
static

Definition at line 164 of file symbol.c.

References is_global_name_punct(), is_identchar, ISASCII, ISDIGIT, and rb_enc_mbclen().

Referenced by rb_enc_symname_type().

◆ lookup_id_str()

static VALUE lookup_id_str ( ID  id)
static

Definition at line 548 of file symbol.c.

References get_id_entry(), ID_ENTRY_STR, and rb_id_to_serial().

Referenced by Init_sym(), rb_id2str(), rb_id_attrset(), and sym_check_asciionly().

◆ lookup_str_id()

static ID lookup_str_id ( VALUE  str)
static

◆ lookup_str_sym()

static VALUE lookup_str_sym ( const VALUE  str)
static

◆ next_id_base()

static ID next_id_base ( void  )
static

Definition at line 568 of file symbol.c.

References global_symbols, ID_SCOPE_SHIFT, and symbols::last_id.

Referenced by intern_str(), rb_make_internal_id(), and rb_sym2id().

◆ rb_check_id()

ID rb_check_id ( volatile VALUE namep)

Returns ID for the given name if it is interned already, or 0.

Parameters
namepthe pointer to the name object
Returns
the ID for *namep
Precondition
the object referred by namep must be a Symbol or a String, or possible to convert with to_str method.
Postcondition
the object referred by namep is a Symbol or a String if non-zero value is returned, or is a String if 0 is returned.

Definition at line 923 of file symbol.c.

References DYNAMIC_SYM_P, lookup_str_id(), name, NIL_P, PRIsVALUE, rb_check_string_type(), rb_eTypeError, rb_raise(), RB_TYPE_P, RSYMBOL, STATIC_SYM2ID, STATIC_SYM_P, sym_check_asciionly(), SYMBOL_PINNED_P, and T_STRING.

Referenced by check_definition(), check_exec_redirect(), check_exec_redirect_fd(), check_id_type(), check_local_id(), check_setter_id(), classname(), enum_inject(), iseq_type_from_sym(), obj_method(), obj_respond_to(), rb_execarg_addopt(), rb_f_send(), rb_f_untrace_var(), rb_mod_alias_method(), rb_mod_autoload_p(), rb_mod_const_defined(), rb_mod_const_get(), rb_mod_define_method(), rb_mod_instance_method(), rb_mod_method_defined(), rb_mod_public_instance_method(), rb_mod_remove_method(), rb_mod_undef_method(), rb_obj_singleton_method(), rb_thread_aref(), rb_thread_key_p(), rb_thread_variable_p(), send_internal(), set_const_visibility(), set_method_visibility(), and vm_call_opt_send().

◆ rb_check_id_cstr()

ID rb_check_id_cstr ( const char *  ptr,
long  len,
rb_encoding enc 
)

◆ rb_check_symbol()

VALUE rb_check_symbol ( volatile VALUE namep)

◆ rb_check_symbol_cstr()

VALUE rb_check_symbol_cstr ( const char *  ptr,
long  len,
rb_encoding enc 
)

◆ rb_enc_symname2_p()

int rb_enc_symname2_p ( const char *  name,
long  len,
rb_encoding enc 
)

Definition at line 311 of file symbol.c.

References IDSET_ATTRSET_FOR_SYNTAX, and rb_enc_symname_type().

Referenced by rb_enc_symname_p(), and reg_named_capture_assign_iter().

◆ rb_enc_symname_p()

int rb_enc_symname_p ( const char *  name,
rb_encoding enc 
)

Definition at line 196 of file symbol.c.

References rb_enc_symname2_p(), and strlen().

Referenced by rb_str_symname_p(), and rb_symname_p().

◆ rb_enc_symname_type()

static int rb_enc_symname_type ( const char *  name,
long  len,
rb_encoding enc,
unsigned int  allowed_attrset 
)
static

◆ rb_gc_free_dsymbol()

void rb_gc_free_dsymbol ( VALUE  sym)

Definition at line 629 of file symbol.c.

References symbols::dsymbol_fstr_hash, global_symbols, rb_hash_delete_entry(), RSYMBOL, and unregister_sym().

Referenced by obj_free().

◆ rb_id2name()

const char* rb_id2name ( ID  id)

◆ rb_id2str()

VALUE rb_id2str ( ID  id)

Definition at line 745 of file symbol.c.

References lookup_id_str(), rb_cString, RBASIC, and RBASIC_SET_CLASS_RAW.

Referenced by rb_id2name(), rb_id_attrget(), rb_id_attrset(), and rb_sym2str().

◆ rb_id2sym()

VALUE rb_id2sym ( ID  x)

Definition at line 726 of file symbol.c.

References DYNAMIC_ID_P, get_id_entry(), ID_ENTRY_SYM, rb_id_to_serial(), and STATIC_ID2SYM.

◆ rb_id_attrget()

ID rb_id_attrget ( ID  id)

Definition at line 158 of file symbol.c.

References attrsetname_to_attr(), and rb_id2str().

◆ rb_id_attrset()

ID rb_id_attrset ( ID  id)

◆ rb_id_serial_to_id()

static ID rb_id_serial_to_id ( rb_id_serial_t  num)
inlinestatic

Definition at line 359 of file symbol.c.

References get_id_entry(), ID_ENTRY_SYM, is_notop_id, key, PRIsVALUE, PRIxVALUE, rb_fatal(), ST_CONTINUE, st_data_t, and SYM2ID.

Referenced by key2id().

◆ rb_intern()

ID rb_intern ( const char *  name)

Definition at line 611 of file symbol.c.

References rb_intern2(), and strlen().

◆ rb_intern2()

ID rb_intern2 ( const char *  name,
long  len 
)

◆ rb_intern3()

ID rb_intern3 ( const char *  name,
long  len,
rb_encoding enc 
)

Definition at line 554 of file symbol.c.

References intern_str(), lookup_str_sym(), OBJ_FREEZE, rb_enc_str_new(), rb_setup_fake_str(), rb_sym2id(), and sym.

Referenced by rb_intern2().

◆ rb_intern_str()

ID rb_intern_str ( VALUE  str)

Definition at line 617 of file symbol.c.

References intern_str(), lookup_str_sym(), and SYM2ID.

◆ rb_is_attrset_id()

int rb_is_attrset_id ( ID  id)

Definition at line 852 of file symbol.c.

References is_attrset_id.

Referenced by iseq_compile_each().

◆ rb_is_attrset_name()

int rb_is_attrset_name ( VALUE  name)

Definition at line 1108 of file symbol.c.

References ID_ATTRSET, IDSET_ATTRSET_FOR_INTERN, and rb_str_symname_type().

Referenced by attrsetname_to_attr().

◆ rb_is_attrset_sym()

int rb_is_attrset_sym ( VALUE  sym)

Definition at line 894 of file symbol.c.

References is_attrset_sym.

◆ rb_is_class_id()

int rb_is_class_id ( ID  id)

Definition at line 834 of file symbol.c.

References is_class_id.

Referenced by cv_i(), and cv_intern().

◆ rb_is_class_name()

int rb_is_class_name ( VALUE  name)

Definition at line 1090 of file symbol.c.

References ID_CLASS, and rb_str_symname_type().

◆ rb_is_class_sym()

int rb_is_class_sym ( VALUE  sym)

Definition at line 876 of file symbol.c.

References is_class_sym.

◆ rb_is_const_id()

int rb_is_const_id ( ID  id)

◆ rb_is_const_name()

int rb_is_const_name ( VALUE  name)

Definition at line 1084 of file symbol.c.

References ID_CONST, and rb_str_symname_type().

Referenced by new_struct(), rb_is_attr_name(), rb_mod_const_defined(), and rb_mod_const_get().

◆ rb_is_const_sym()

int rb_is_const_sym ( VALUE  sym)

Definition at line 870 of file symbol.c.

References is_const_sym.

Referenced by rb_mod_const_defined(), and rb_mod_const_get().

◆ rb_is_global_id()

int rb_is_global_id ( ID  id)

Definition at line 840 of file symbol.c.

References is_global_id.

◆ rb_is_global_name()

int rb_is_global_name ( VALUE  name)

Definition at line 1096 of file symbol.c.

References ID_GLOBAL, and rb_str_symname_type().

◆ rb_is_global_sym()

int rb_is_global_sym ( VALUE  sym)

Definition at line 882 of file symbol.c.

References is_global_sym.

◆ rb_is_instance_id()

int rb_is_instance_id ( ID  id)

Definition at line 846 of file symbol.c.

References is_instance_id.

Referenced by inspect_i(), and ivar_i().

◆ rb_is_instance_name()

int rb_is_instance_name ( VALUE  name)

Definition at line 1102 of file symbol.c.

References ID_INSTANCE, and rb_str_symname_type().

◆ rb_is_instance_sym()

int rb_is_instance_sym ( VALUE  sym)

Definition at line 888 of file symbol.c.

References is_instance_sym.

◆ rb_is_junk_id()

int rb_is_junk_id ( ID  id)

Definition at line 864 of file symbol.c.

References is_junk_id.

◆ rb_is_junk_name()

int rb_is_junk_name ( VALUE  name)

Definition at line 1130 of file symbol.c.

References IDSET_ATTRSET_FOR_SYNTAX, and rb_str_symname_type().

◆ rb_is_junk_sym()

int rb_is_junk_sym ( VALUE  sym)

Definition at line 906 of file symbol.c.

References is_junk_sym.

◆ rb_is_local_id()

int rb_is_local_id ( ID  id)

Definition at line 858 of file symbol.c.

References is_local_id.

Referenced by check_local_id(), inspect_struct(), local_var_list_add(), and rb_is_attr_id().

◆ rb_is_local_name()

int rb_is_local_name ( VALUE  name)

Definition at line 1114 of file symbol.c.

References ID_LOCAL, and rb_str_symname_type().

Referenced by check_local_id(), and rb_is_attr_name().

◆ rb_is_local_sym()

int rb_is_local_sym ( VALUE  sym)

Definition at line 900 of file symbol.c.

References is_local_sym.

◆ rb_is_method_name()

int rb_is_method_name ( VALUE  name)

Definition at line 1120 of file symbol.c.

References FALSE, ID_ATTRSET, ID_JUNK, ID_LOCAL, rb_str_symname_type(), and TRUE.

◆ rb_make_internal_id()

ID rb_make_internal_id ( void  )

Definition at line 768 of file symbol.c.

References ID_INTERNAL, ID_STATIC_SYM, and next_id_base().

Referenced by Init_Exception(), and Init_pack().

◆ rb_str_intern()

VALUE rb_str_intern ( VALUE  str)

◆ rb_str_symname_type()

static int rb_str_symname_type ( VALUE  name,
unsigned int  allowed_attrset 
)
static

◆ rb_sym2id()

ID rb_sym2id ( VALUE  sym)

◆ rb_sym2str()

VALUE rb_sym2str ( VALUE  sym)

Definition at line 734 of file symbol.c.

References DYNAMIC_SYM_P, rb_id2str(), RSYMBOL, and STATIC_SYM2ID.

◆ rb_sym_all_symbols()

VALUE rb_sym_all_symbols ( void  )

◆ rb_sym_immortal_count()

size_t rb_sym_immortal_count ( void  )

Definition at line 822 of file symbol.c.

References global_symbols, and symbols::last_id.

Referenced by count_symbols(), cs_i(), and is_global_name_punct().

◆ rb_sym_intern()

VALUE rb_sym_intern ( const char *  ptr,
long  len,
rb_encoding enc 
)

◆ rb_sym_intern_ascii()

VALUE rb_sym_intern_ascii ( const char *  ptr,
long  len 
)

Definition at line 1044 of file symbol.c.

References rb_sym_intern(), and rb_usascii_encoding().

Referenced by rb_check_symbol_cstr(), and rb_sym_intern_ascii_cstr().

◆ rb_sym_intern_ascii_cstr()

VALUE rb_sym_intern_ascii_cstr ( const char *  ptr)

◆ rb_sym_intern_cstr()

VALUE rb_sym_intern_cstr ( const char *  ptr,
rb_encoding enc 
)

Definition at line 1038 of file symbol.c.

References rb_sym_intern(), and strlen().

Referenced by rb_check_symbol_cstr().

◆ rb_symname_p()

int rb_symname_p ( const char *  name)

Definition at line 190 of file symbol.c.

References rb_ascii8bit_encoding(), and rb_enc_symname_p().

◆ register_static_symid()

static ID register_static_symid ( ID  id,
const char *  name,
long  len,
rb_encoding enc 
)
static

Definition at line 404 of file symbol.c.

References rb_enc_str_new(), and register_static_symid_str().

Referenced by Init_op_tbl().

◆ register_static_symid_str()

static ID register_static_symid_str ( ID  id,
VALUE  str 
)
static

◆ register_sym()

static void register_sym ( VALUE  str,
VALUE  sym 
)
static

Definition at line 384 of file symbol.c.

References global_symbols, st_add_direct, st_data_t, st_update(), and symbols::str_sym.

Referenced by dsymbol_alloc(), and register_static_symid_str().

◆ set_id_entry()

static void set_id_entry ( rb_id_serial_t  num,
VALUE  str,
VALUE  sym 
)
static

◆ STATIC_ASSERT()

STATIC_ASSERT ( op_tbl_name_size  ,
sizeof(op_tbl[0].name = =3 
)

◆ sym_check_asciionly()

static int sym_check_asciionly ( VALUE  str)
static

◆ symbols_i()

static int symbols_i ( st_data_t  key,
st_data_t  value,
st_data_t  arg 
)
static

◆ unregister_sym()

static void unregister_sym ( VALUE  str,
VALUE  sym 
)
static

Definition at line 395 of file symbol.c.

References global_symbols, NULL, rb_bug(), RSTRING_PTR, st_data_t, st_delete, and symbols::str_sym.

Referenced by dsymbol_check(), and rb_gc_free_dsymbol().

◆ WARN_UNUSED_RESULT() [1/7]

WARN_UNUSED_RESULT ( static VALUE   dsymbol_allocconst VALUE klass, const VALUE str, rb_encoding *const enc, const ID type)

Referenced by Init_sym().

◆ WARN_UNUSED_RESULT() [2/7]

WARN_UNUSED_RESULT ( static VALUE   dsymbol_checkconst VALUE sym)

◆ WARN_UNUSED_RESULT() [3/7]

WARN_UNUSED_RESULT ( static ID   lookup_str_idVALUE str)

◆ WARN_UNUSED_RESULT() [4/7]

WARN_UNUSED_RESULT ( static VALUE   lookup_str_symconst VALUE str)

◆ WARN_UNUSED_RESULT() [5/7]

WARN_UNUSED_RESULT ( static VALUE   lookup_id_strID id)

◆ WARN_UNUSED_RESULT() [6/7]

WARN_UNUSED_RESULT ( static ID   attrsetname_to_attrVALUE name)

◆ WARN_UNUSED_RESULT() [7/7]

WARN_UNUSED_RESULT ( static ID   intern_strVALUE str, int mutable)

Variable Documentation

◆ global_symbols

struct symbols global_symbols = {tNEXT_ID-1}
static

◆ symhash

const struct st_hash_type symhash
static
Initial value:
= {
}
st_index_t rb_str_hash(VALUE)
Definition: string.c:2985
int rb_str_hash_cmp(VALUE, VALUE)
Definition: string.c:2995

Definition at line 69 of file symbol.c.