Ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5ad0e4688e963d9de019557c78feed9)
Data Structures | Macros | Typedefs | Functions | Variables
hash.c File Reference
#include "ruby/encoding.h"
#include "ruby/st.h"
#include "ruby/util.h"
#include "internal.h"
#include <errno.h>
#include "probes.h"
#include "id.h"
#include "symbol.h"
#include "debug_counter.h"
#include "transient_heap.h"
#include "ruby_assert.h"

Go to the source code of this file.

Data Structures

struct  ar_table_pair_struct
 
struct  ar_table_struct
 
struct  functor
 
struct  foreach_safe_arg
 
struct  hash_foreach_arg
 
struct  update_callback_arg
 
struct  update_arg
 
struct  rehash_arg
 
struct  shift_var
 
struct  equal_data
 
struct  update_func_arg
 
struct  reset_hash_type_arg
 

Macros

#define HASH_DEBUG   0
 
#define HAS_EXTRA_STATES(hash, klass)
 
#define SET_DEFAULT(hash, ifnone)
 
#define SET_PROC_DEFAULT(hash, proc)   set_proc_default(hash, proc)
 
#define COPY_DEFAULT(hash, hash2)   copy_default(RHASH(hash), RHASH(hash2))
 
#define st_index_hash(index)   key64_hash(rb_hash_start(index), prime2)
 
#define rb_ident_cmp   st_numcmp
 
#define identhash   rb_hashtype_ident
 
#define RHASH_AR_TABLE_MAX_BOUND   RHASH_AR_TABLE_MAX_SIZE
 
#define RHASH_AR_TABLE_REF(hash, n)   (&RHASH_AR_TABLE(hash)->pairs[n])
 
#define RHASH_AR_CLEARED_HINT   0xff
 
#define RHASH_AR_TABLE_SIZE(h)
 
#define RHASH_AR_TABLE_BOUND_RAW(h)
 
#define RHASH_AR_TABLE_BOUND(h)
 
#define RHASH_ST_TABLE_SET(h, s)   rb_hash_st_table_set(h, s)
 
#define RHASH_TYPE(hash)   (RHASH_AR_TABLE_P(hash) ? &objhash : RHASH_ST_TABLE(hash)->type)
 
#define HASH_ASSERT(expr)   RUBY_ASSERT_MESG_WHEN(HASH_DEBUG, expr, #expr)
 
#define hash_verify(h)   ((void)0)
 
#define RHASH_SET_ST_FLAG(h)   FL_SET_RAW(h, RHASH_ST_TABLE_FLAG)
 
#define RHASH_UNSET_ST_FLAG(h)   FL_UNSET_RAW(h, RHASH_ST_TABLE_FLAG)
 
#define RHASH_AR_TABLE_SIZE_INC(h)   HASH_AR_TABLE_SIZE_ADD(h, 1)
 
#define NOINSERT_UPDATE_CALLBACK(func)
 
#define UPDATE_CALLBACK(iter_lev, func)   ((iter_lev) > 0 ? func##_noinsert : func##_insert)
 
#define RHASH_UPDATE_ITER(h, iter_lev, key, func, a)
 
#define RHASH_UPDATE(hash, key, func, arg)    RHASH_UPDATE_ITER(hash, RHASH_ITER_LEV(hash), key, func, arg)
 
#define to_hash   rb_to_hash_type
 
#define GET_ENVIRON(e)   (e)
 
#define FREE_ENVIRON(e)
 
#define ENVMATCH(n1, n2)   (strcmp((n1), (n2)) == 0)
 
#define ENVNMATCH(s1, s2, n)   (memcmp((s1), (s2), (n)) == 0)
 
#define get_env_ptr(var, val)    (var = get_env_cstr(val, #var))
 
#define env_name(s)   env_name(&(s))
 
#define rb_intern(str)   rb_intern_const(str)
 

Typedefs

typedef st_index_t st_hash_t
 
typedef struct ar_table_pair_struct ar_table_pair
 
typedef struct ar_table_struct ar_table
 
typedef int st_foreach_func(st_data_t, st_data_t, st_data_t)
 
typedef int rb_foreach_func(VALUE, VALUE, VALUE)
 
typedef int(* tbl_update_func) (st_data_t *, st_data_t *, st_data_t, int)
 

Functions

VALUE rb_hash_freeze (VALUE hash)
 
VALUE rb_hash_set_ifnone (VALUE hash, VALUE ifnone)
 
VALUE rb_hash (VALUE obj)
 
long rb_dbl_long_hash (double d)
 
size_t rb_hash_ar_table_size (void)
 
int rb_hash_ar_table_p (VALUE hash)
 
ar_tablerb_hash_ar_table (VALUE hash)
 
st_tablerb_hash_st_table (VALUE hash)
 
void rb_hash_st_table_set (VALUE hash, st_table *st)
 
 NOINLINE (static int ar_equal(VALUE x, VALUE y))
 
void rb_hash_transient_heap_evacuate (VALUE hash, int promote)
 
void st_foreach_safe (st_table *table, st_foreach_func *func, st_data_t a)
 
void rb_ivar_set_internal (VALUE obj, ID id, VALUE val)
 
int rb_hash_stlike_foreach (VALUE hash, st_foreach_callback_func *func, st_data_t arg)
 
int rb_hash_stlike_foreach_with_replace (VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg)
 
void rb_hash_foreach (VALUE hash, rb_foreach_func *func, VALUE farg)
 
VALUE rb_hash_new (void)
 
MJIT_FUNC_EXPORTED VALUE rb_hash_new_with_size (st_index_t size)
 
VALUE rb_hash_dup (VALUE hash)
 
MJIT_FUNC_EXPORTED VALUE rb_hash_resurrect (VALUE hash)
 
MJIT_FUNC_EXPORTED struct st_tablerb_hash_tbl_raw (VALUE hash)
 
struct st_tablerb_hash_tbl (VALUE hash, const char *file, int line)
 
 NORETURN (static void no_new_key(void))
 
int rb_hash_stlike_update (VALUE hash, st_data_t key, st_update_callback_func func, st_data_t arg)
 
VALUE rb_to_hash_type (VALUE hash)
 
VALUE rb_check_hash_type (VALUE hash)
 
VALUE rb_hash_rehash (VALUE hash)
 
VALUE rb_hash_default_value (VALUE hash, VALUE key)
 
MJIT_FUNC_EXPORTED int rb_hash_stlike_lookup (VALUE hash, st_data_t key, st_data_t *pval)
 
VALUE rb_hash_aref (VALUE hash, VALUE key)
 
VALUE rb_hash_lookup2 (VALUE hash, VALUE key, VALUE def)
 
VALUE rb_hash_lookup (VALUE hash, VALUE key)
 
VALUE rb_hash_fetch (VALUE hash, VALUE key)
 
VALUE rb_hash_set_default_proc (VALUE hash, VALUE proc)
 
int rb_hash_stlike_delete (VALUE hash, st_data_t *pkey, st_data_t *pval)
 
VALUE rb_hash_delete_entry (VALUE hash, VALUE key)
 
VALUE rb_hash_delete (VALUE hash, VALUE key)
 
VALUE rb_hash_delete_if (VALUE hash)
 
VALUE rb_hash_reject_bang (VALUE hash)
 
VALUE rb_hash_reject (VALUE hash)
 
VALUE rb_hash_values_at (int argc, VALUE *argv, VALUE hash)
 
VALUE rb_hash_fetch_values (int argc, VALUE *argv, VALUE hash)
 
VALUE rb_hash_select (VALUE hash)
 
VALUE rb_hash_select_bang (VALUE hash)
 
VALUE rb_hash_keep_if (VALUE hash)
 
VALUE rb_hash_clear (VALUE hash)
 
VALUE rb_hash_key_str (VALUE key)
 
VALUE rb_hash_aset (VALUE hash, VALUE key, VALUE val)
 
VALUE rb_hash_size (VALUE hash)
 
size_t rb_hash_size_num (VALUE hash)
 
VALUE rb_hash_set_pair (VALUE hash, VALUE arg)
 
MJIT_FUNC_EXPORTED VALUE rb_hash_keys (VALUE hash)
 
VALUE rb_hash_values (VALUE hash)
 
MJIT_FUNC_EXPORTED VALUE rb_hash_has_key (VALUE hash, VALUE key)
 
VALUE rb_hash_update_by (VALUE hash1, VALUE hash2, rb_hash_update_func *func)
 
VALUE rb_hash_assoc (VALUE hash, VALUE key)
 
VALUE rb_hash_rassoc (VALUE hash, VALUE obj)
 
MJIT_FUNC_EXPORTED VALUE rb_hash_compare_by_id_p (VALUE hash)
 
VALUE rb_ident_hash_new (void)
 
st_tablerb_init_identtable (void)
 
int rb_hash_add_new_element (VALUE hash, VALUE key, VALUE val)
 
void rb_hash_bulk_insert (long argc, const VALUE *argv, VALUE hash)
 
int rb_env_path_tainted (void)
 
void ruby_setenv (const char *name, const char *value)
 
void ruby_unsetenv (const char *name)
 
VALUE rb_env_clear (void)
 
void Init_Hash (void)
 

Variables

VALUE rb_cHash
 
const struct st_hash_type rb_hashtype_ident
 
char ** environ
 
bool ruby_tz_uptodate_p
 

Macro Definition Documentation

◆ COPY_DEFAULT

#define COPY_DEFAULT (   hash,
  hash2 
)    copy_default(RHASH(hash), RHASH(hash2))

Definition at line 52 of file hash.c.

◆ env_name

#define env_name (   s)    env_name(&(s))

Definition at line 4762 of file hash.c.

◆ ENVMATCH

#define ENVMATCH (   n1,
  n2 
)    (strcmp((n1), (n2)) == 0)

Definition at line 4653 of file hash.c.

◆ ENVNMATCH

#define ENVNMATCH (   s1,
  s2,
  n 
)    (memcmp((s1), (s2), (n)) == 0)

Definition at line 4654 of file hash.c.

◆ FREE_ENVIRON

#define FREE_ENVIRON (   e)

Definition at line 4647 of file hash.c.

◆ get_env_ptr

#define get_env_ptr (   var,
  val 
)     (var = get_env_cstr(val, #var))

Definition at line 4749 of file hash.c.

◆ GET_ENVIRON

#define GET_ENVIRON (   e)    (e)

Definition at line 4646 of file hash.c.

◆ HAS_EXTRA_STATES

#define HAS_EXTRA_STATES (   hash,
  klass 
)
Value:
( \
((klass = has_extra_methods(rb_obj_class(hash))) != 0) || \
FL_TEST((hash), FL_EXIVAR|RHASH_PROC_DEFAULT) || \
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
Definition: object.c:217
#define FL_EXIVAR
#define RHASH_IFNONE(h)
#define NIL_P(v)

Definition at line 41 of file hash.c.

◆ HASH_ASSERT

#define HASH_ASSERT (   expr)    RUBY_ASSERT_MESG_WHEN(HASH_DEBUG, expr, #expr)

Definition at line 435 of file hash.c.

◆ HASH_DEBUG

#define HASH_DEBUG   0

Definition at line 34 of file hash.c.

◆ hash_verify

#define hash_verify (   h)    ((void)0)

Definition at line 510 of file hash.c.

◆ identhash

#define identhash   rb_hashtype_ident

Definition at line 321 of file hash.c.

◆ NOINSERT_UPDATE_CALLBACK

#define NOINSERT_UPDATE_CALLBACK (   func)
Value:
static int \
func##_noinsert(st_data_t *key, st_data_t *val, st_data_t arg, int existing) \
{ \
if (!existing) no_new_key(); \
return func(key, val, (struct update_arg *)arg, existing); \
} \
\
static int \
func##_insert(st_data_t *key, st_data_t *val, st_data_t arg, int existing) \
{ \
return func(key, val, (struct update_arg *)arg, existing); \
}
unsigned long st_data_t

Definition at line 1625 of file hash.c.

◆ rb_ident_cmp

#define rb_ident_cmp   st_numcmp

Definition at line 302 of file hash.c.

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

◆ RHASH_AR_CLEARED_HINT

#define RHASH_AR_CLEARED_HINT   0xff

Definition at line 342 of file hash.c.

◆ RHASH_AR_TABLE_BOUND

#define RHASH_AR_TABLE_BOUND (   h)
Value:
RHASH_AR_TABLE_BOUND_RAW(h))
#define HASH_ASSERT(expr)
Definition: hash.c:435
#define RHASH_AR_TABLE_P(hash)
size_t st_index_t h

Definition at line 429 of file hash.c.

◆ RHASH_AR_TABLE_BOUND_RAW

#define RHASH_AR_TABLE_BOUND_RAW (   h)
Value:
((unsigned int)((RBASIC(h)->flags >> RHASH_AR_TABLE_BOUND_SHIFT) & \
#define RBASIC(obj)
#define RHASH_AR_TABLE_BOUND_SHIFT
#define RHASH_AR_TABLE_BOUND_MASK
__inline__ int

Definition at line 425 of file hash.c.

◆ RHASH_AR_TABLE_MAX_BOUND

#define RHASH_AR_TABLE_MAX_BOUND   RHASH_AR_TABLE_MAX_SIZE

Definition at line 339 of file hash.c.

◆ RHASH_AR_TABLE_REF

#define RHASH_AR_TABLE_REF (   hash,
  n 
)    (&RHASH_AR_TABLE(hash)->pairs[n])

Definition at line 341 of file hash.c.

◆ RHASH_AR_TABLE_SIZE

#define RHASH_AR_TABLE_SIZE (   h)
Value:
RHASH_AR_TABLE_SIZE_RAW(h))

Definition at line 422 of file hash.c.

◆ RHASH_AR_TABLE_SIZE_INC

#define RHASH_AR_TABLE_SIZE_INC (   h)    HASH_AR_TABLE_SIZE_ADD(h, 1)

Definition at line 607 of file hash.c.

◆ RHASH_SET_ST_FLAG

#define RHASH_SET_ST_FLAG (   h)    FL_SET_RAW(h, RHASH_ST_TABLE_FLAG)

Definition at line 574 of file hash.c.

◆ RHASH_ST_TABLE_SET

#define RHASH_ST_TABLE_SET (   h,
 
)    rb_hash_st_table_set(h, s)

Definition at line 432 of file hash.c.

◆ RHASH_TYPE

#define RHASH_TYPE (   hash)    (RHASH_AR_TABLE_P(hash) ? &objhash : RHASH_ST_TABLE(hash)->type)

Definition at line 433 of file hash.c.

◆ RHASH_UNSET_ST_FLAG

#define RHASH_UNSET_ST_FLAG (   h)    FL_UNSET_RAW(h, RHASH_ST_TABLE_FLAG)

Definition at line 575 of file hash.c.

◆ RHASH_UPDATE

#define RHASH_UPDATE (   hash,
  key,
  func,
  arg 
)     RHASH_UPDATE_ITER(hash, RHASH_ITER_LEV(hash), key, func, arg)

Definition at line 1694 of file hash.c.

◆ RHASH_UPDATE_ITER

#define RHASH_UPDATE_ITER (   h,
  iter_lev,
  key,
  func,
 
)
Value:
do { \
tbl_update((h), (key), UPDATE_CALLBACK((iter_lev), func), (st_data_t)(a)); \
} while (0)
#define UPDATE_CALLBACK(iter_lev, func)
Definition: hash.c:1688

Definition at line 1690 of file hash.c.

◆ SET_DEFAULT

#define SET_DEFAULT (   hash,
  ifnone 
)
Value:
( \
FL_UNSET_RAW(hash, RHASH_PROC_DEFAULT), \
RHASH_SET_IFNONE(hash, ifnone))

Definition at line 46 of file hash.c.

◆ SET_PROC_DEFAULT

#define SET_PROC_DEFAULT (   hash,
  proc 
)    set_proc_default(hash, proc)

Definition at line 50 of file hash.c.

◆ st_index_hash

#define st_index_hash (   index)    key64_hash(rb_hash_start(index), prime2)

Definition at line 265 of file hash.c.

◆ to_hash

#define to_hash   rb_to_hash_type

Definition at line 1849 of file hash.c.

◆ UPDATE_CALLBACK

#define UPDATE_CALLBACK (   iter_lev,
  func 
)    ((iter_lev) > 0 ? func##_noinsert : func##_insert)

Definition at line 1688 of file hash.c.

Typedef Documentation

◆ ar_table

typedef struct ar_table_struct ar_table

◆ ar_table_pair

◆ rb_foreach_func

typedef int rb_foreach_func(VALUE, VALUE, VALUE)

Definition at line 1306 of file hash.c.

◆ st_foreach_func

typedef int st_foreach_func(st_data_t, st_data_t, st_data_t)

Definition at line 1271 of file hash.c.

◆ st_hash_t

Definition at line 327 of file hash.c.

◆ tbl_update_func

typedef int(* tbl_update_func) (st_data_t *, st_data_t *, st_data_t, int)

Definition at line 1648 of file hash.c.

Function Documentation

◆ Init_Hash()

void Init_Hash ( void  )

Definition at line 6313 of file hash.c.

References id_hash, id_yield, and rb_intern.

◆ NOINLINE()

NOINLINE ( static int   ar_equalVALUE x, VALUE y)

◆ NORETURN()

NORETURN ( static void   no_new_keyvoid)

◆ rb_check_hash_type()

VALUE rb_check_hash_type ( VALUE  hash)

Definition at line 1852 of file hash.c.

Referenced by rb_Hash().

◆ rb_dbl_long_hash()

long rb_dbl_long_hash ( double  d)

Definition at line 160 of file hash.c.

References rb_memhash().

◆ rb_env_clear()

VALUE rb_env_clear ( void  )

Definition at line 5628 of file hash.c.

References i, and keys.

◆ rb_env_path_tainted()

int rb_env_path_tainted ( void  )

Definition at line 4904 of file hash.c.

References rb_warning().

◆ rb_hash()

VALUE rb_hash ( VALUE  obj)

Definition at line 129 of file hash.c.

References rb_exec_recursive_outer().

◆ rb_hash_add_new_element()

int rb_hash_add_new_element ( VALUE  hash,
VALUE  key,
VALUE  val 
)

Definition at line 4547 of file hash.c.

◆ rb_hash_ar_table()

ar_table * rb_hash_ar_table ( VALUE  hash)

Definition at line 544 of file hash.c.

◆ rb_hash_ar_table_p()

int rb_hash_ar_table_p ( VALUE  hash)

Definition at line 532 of file hash.c.

◆ rb_hash_ar_table_size()

size_t rb_hash_ar_table_size ( void  )

Definition at line 355 of file hash.c.

◆ rb_hash_aref()

VALUE rb_hash_aref ( VALUE  hash,
VALUE  key 
)

Definition at line 2037 of file hash.c.

Referenced by rb_econv_open_opts(), and rb_iseq_build_from_ary().

◆ rb_hash_aset()

VALUE rb_hash_aset ( VALUE  hash,
VALUE  key,
VALUE  val 
)

Definition at line 2852 of file hash.c.

Referenced by Init_GC(), rb_ast_add_mark_object(), rb_iseq_new_top(), and rb_uninterruptible().

◆ rb_hash_assoc()

VALUE rb_hash_assoc ( VALUE  hash,
VALUE  key 
)

Definition at line 4017 of file hash.c.

◆ rb_hash_bulk_insert()

void rb_hash_bulk_insert ( long  argc,
const VALUE argv,
VALUE  hash 
)

Definition at line 4590 of file hash.c.

◆ rb_hash_clear()

VALUE rb_hash_clear ( VALUE  hash)

Definition at line 2769 of file hash.c.

◆ rb_hash_compare_by_id_p()

MJIT_FUNC_EXPORTED VALUE rb_hash_compare_by_id_p ( VALUE  hash)

Definition at line 4267 of file hash.c.

◆ rb_hash_default_value()

VALUE rb_hash_default_value ( VALUE  hash,
VALUE  key 
)

Definition at line 1990 of file hash.c.

◆ rb_hash_delete()

VALUE rb_hash_delete ( VALUE  hash,
VALUE  key 
)

Definition at line 2344 of file hash.c.

◆ rb_hash_delete_entry()

VALUE rb_hash_delete_entry ( VALUE  hash,
VALUE  key 
)

Definition at line 2326 of file hash.c.

◆ rb_hash_delete_if()

VALUE rb_hash_delete_if ( VALUE  hash)

Definition at line 2493 of file hash.c.

◆ rb_hash_dup()

VALUE rb_hash_dup ( VALUE  hash)

Definition at line 1564 of file hash.c.

◆ rb_hash_fetch()

VALUE rb_hash_fetch ( VALUE  hash,
VALUE  key 
)

Definition at line 2134 of file hash.c.

◆ rb_hash_fetch_values()

VALUE rb_hash_fetch_values ( int  argc,
VALUE argv,
VALUE  hash 
)

Definition at line 2640 of file hash.c.

◆ rb_hash_foreach()

void rb_hash_foreach ( VALUE  hash,
rb_foreach_func func,
VALUE  farg 
)

Definition at line 1483 of file hash.c.

◆ rb_hash_freeze()

VALUE rb_hash_freeze ( VALUE  hash)

Definition at line 87 of file hash.c.

◆ rb_hash_has_key()

MJIT_FUNC_EXPORTED VALUE rb_hash_has_key ( VALUE  hash,
VALUE  key 
)

Definition at line 3507 of file hash.c.

◆ rb_hash_keep_if()

VALUE rb_hash_keep_if ( VALUE  hash)

Definition at line 2741 of file hash.c.

◆ rb_hash_key_str()

VALUE rb_hash_key_str ( VALUE  key)

Definition at line 2802 of file hash.c.

References FL_EXIVAR, key, rb_cString, RB_FL_ANY_RAW, rb_fstring(), rb_str_new_frozen(), and RBASIC_CLASS.

◆ rb_hash_keys()

MJIT_FUNC_EXPORTED VALUE rb_hash_keys ( VALUE  hash)

Definition at line 3409 of file hash.c.

◆ rb_hash_lookup()

VALUE rb_hash_lookup ( VALUE  hash,
VALUE  key 
)

Definition at line 2063 of file hash.c.

◆ rb_hash_lookup2()

VALUE rb_hash_lookup2 ( VALUE  hash,
VALUE  key,
VALUE  def 
)

Definition at line 2050 of file hash.c.

Referenced by rb_io_extract_encoding_option().

◆ rb_hash_new()

VALUE rb_hash_new ( void  )

Definition at line 1523 of file hash.c.

Referenced by Init_GC(), Init_limits(), Init_sizeof(), rb_Hash(), and rb_hash_new_with_size().

◆ rb_hash_new_with_size()

MJIT_FUNC_EXPORTED VALUE rb_hash_new_with_size ( st_index_t  size)

Definition at line 1529 of file hash.c.

References rb_hash_new(), RHASH_AR_TABLE_MAX_SIZE, and size.

◆ rb_hash_rassoc()

VALUE rb_hash_rassoc ( VALUE  hash,
VALUE  obj 
)

Definition at line 4078 of file hash.c.

◆ rb_hash_rehash()

VALUE rb_hash_rehash ( VALUE  hash)

Definition at line 1958 of file hash.c.

◆ rb_hash_reject()

VALUE rb_hash_reject ( VALUE  hash)

Definition at line 2550 of file hash.c.

◆ rb_hash_reject_bang()

VALUE rb_hash_reject_bang ( VALUE  hash)

Definition at line 2513 of file hash.c.

◆ rb_hash_resurrect()

MJIT_FUNC_EXPORTED VALUE rb_hash_resurrect ( VALUE  hash)

Definition at line 1575 of file hash.c.

◆ rb_hash_select()

VALUE rb_hash_select ( VALUE  hash)

Definition at line 2679 of file hash.c.

◆ rb_hash_select_bang()

VALUE rb_hash_select_bang ( VALUE  hash)

Definition at line 2714 of file hash.c.

◆ rb_hash_set_default_proc()

VALUE rb_hash_set_default_proc ( VALUE  hash,
VALUE  proc 
)

Definition at line 2242 of file hash.c.

◆ rb_hash_set_ifnone()

VALUE rb_hash_set_ifnone ( VALUE  hash,
VALUE  ifnone 
)

Definition at line 99 of file hash.c.

◆ rb_hash_set_pair()

VALUE rb_hash_set_pair ( VALUE  hash,
VALUE  arg 
)

Definition at line 3332 of file hash.c.

◆ rb_hash_size()

VALUE rb_hash_size ( VALUE  hash)

Definition at line 2939 of file hash.c.

◆ rb_hash_size_num()

size_t rb_hash_size_num ( VALUE  hash)

Definition at line 2945 of file hash.c.

◆ rb_hash_st_table()

st_table * rb_hash_st_table ( VALUE  hash)

Definition at line 551 of file hash.c.

◆ rb_hash_st_table_set()

void rb_hash_st_table_set ( VALUE  hash,
st_table st 
)

Definition at line 558 of file hash.c.

◆ rb_hash_stlike_delete()

int rb_hash_stlike_delete ( VALUE  hash,
st_data_t pkey,
st_data_t pval 
)

Definition at line 2310 of file hash.c.

◆ rb_hash_stlike_foreach()

int rb_hash_stlike_foreach ( VALUE  hash,
st_foreach_callback_func func,
st_data_t  arg 
)

Definition at line 1442 of file hash.c.

Referenced by rb_execarg_extract_options().

◆ rb_hash_stlike_foreach_with_replace()

int rb_hash_stlike_foreach_with_replace ( VALUE  hash,
st_foreach_check_callback_func func,
st_update_callback_func replace,
st_data_t  arg 
)

Definition at line 1453 of file hash.c.

◆ rb_hash_stlike_lookup()

MJIT_FUNC_EXPORTED int rb_hash_stlike_lookup ( VALUE  hash,
st_data_t  key,
st_data_t pval 
)

Definition at line 2017 of file hash.c.

◆ rb_hash_stlike_update()

int rb_hash_stlike_update ( VALUE  hash,
st_data_t  key,
st_update_callback_func  func,
st_data_t  arg 
)

Definition at line 1651 of file hash.c.

◆ rb_hash_tbl()

struct st_table * rb_hash_tbl ( VALUE  hash,
const char file,
int  line 
)

Definition at line 1601 of file hash.c.

◆ rb_hash_tbl_raw()

MJIT_FUNC_EXPORTED struct st_table * rb_hash_tbl_raw ( VALUE  hash)

Definition at line 1594 of file hash.c.

◆ rb_hash_transient_heap_evacuate()

void rb_hash_transient_heap_evacuate ( VALUE  hash,
int  promote 
)

Definition at line 1244 of file hash.c.

◆ rb_hash_update_by()

VALUE rb_hash_update_by ( VALUE  hash1,
VALUE  hash2,
rb_hash_update_func func 
)

Definition at line 3910 of file hash.c.

◆ rb_hash_values()

VALUE rb_hash_values ( VALUE  hash)

Definition at line 3456 of file hash.c.

◆ rb_hash_values_at()

VALUE rb_hash_values_at ( int  argc,
VALUE argv,
VALUE  hash 
)

Definition at line 2612 of file hash.c.

◆ rb_ident_hash_new()

VALUE rb_ident_hash_new ( void  )

Definition at line 4278 of file hash.c.

Referenced by Init_sym(), rb_ast_add_mark_object(), and rb_uninterruptible().

◆ rb_init_identtable()

st_table * rb_init_identtable ( void  )

Definition at line 4286 of file hash.c.

References identhash, and st_init_table().

◆ rb_ivar_set_internal()

void rb_ivar_set_internal ( VALUE  obj,
ID  id,
VALUE  val 
)

Definition at line 1308 of file variable.c.

References rb_is_instance_id(), and VM_ASSERT.

◆ rb_to_hash_type()

VALUE rb_to_hash_type ( VALUE  hash)

Definition at line 1845 of file hash.c.

◆ ruby_setenv()

void ruby_setenv ( const char name,
const char value 
)

◆ ruby_unsetenv()

void ruby_unsetenv ( const char name)

Definition at line 5137 of file hash.c.

References name, and ruby_setenv().

◆ st_foreach_safe()

void st_foreach_safe ( st_table table,
st_foreach_func func,
st_data_t  a 
)

Definition at line 1294 of file hash.c.

References arg, foreach_safe_arg::func, and st_foreach_check().

Referenced by rb_const_list().

Variable Documentation

◆ environ

char** environ
extern

Referenced by ruby_setenv().

◆ rb_cHash

VALUE rb_cHash

Definition at line 92 of file hash.c.

◆ rb_hashtype_ident

const struct st_hash_type rb_hashtype_ident
Initial value:
= {
rb_ident_hash,
}
#define rb_ident_cmp
Definition: hash.c:302

Definition at line 322 of file hash.c.

◆ ruby_tz_uptodate_p

bool ruby_tz_uptodate_p
extern

Definition at line 674 of file time.c.