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

Go to the source code of this file.

Data Structures

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 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 rb_ident_cmp   st_numcmp
 
#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 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 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

static void copy_default (struct RHash *hash, const struct RHash *hash2)
 
static VALUE has_extra_methods (VALUE klass)
 
static VALUE rb_hash_s_try_convert (VALUE, VALUE)
 
VALUE rb_hash_freeze (VALUE hash)
 
VALUE rb_hash_ifnone (VALUE h)
 
VALUE rb_hash_set_ifnone (VALUE hash, VALUE ifnone)
 
static int rb_any_cmp (VALUE a, VALUE b)
 
static VALUE hash_recursive (VALUE obj, VALUE arg, int recurse)
 
VALUE rb_hash (VALUE obj)
 
long rb_objid_hash (st_index_t index)
 
long rb_dbl_long_hash (double d)
 
static long any_hash (VALUE a, st_index_t(*other_func)(VALUE))
 
static st_index_t obj_any_hash (VALUE obj)
 
static st_index_t rb_any_hash (VALUE a)
 
static uint64_t mult_and_mix (uint64_t m1, uint64_t m2)
 
static uint64_t key64_hash (uint64_t key, uint32_t seed)
 
static st_index_t objid_hash (VALUE obj)
 
VALUE rb_obj_hash (VALUE obj)
 
int rb_hash_iter_lev (VALUE h)
 
static st_index_t rb_ident_hash (st_data_t n)
 
static int foreach_safe_i (st_data_t key, st_data_t value, st_data_t args, int error)
 
void st_foreach_safe (st_table *table, int(*func)(ANYARGS), st_data_t a)
 
static int hash_foreach_iter (st_data_t key, st_data_t value, st_data_t argp, int error)
 
static VALUE hash_foreach_ensure_rollback (VALUE hash)
 
static VALUE hash_foreach_ensure (VALUE hash)
 
static VALUE hash_foreach_call (VALUE arg)
 
void rb_hash_foreach (VALUE hash, int(*func)(ANYARGS), VALUE farg)
 
static VALUE hash_alloc_flags (VALUE klass, VALUE flags, VALUE ifnone)
 
static VALUE hash_alloc (VALUE klass)
 
static VALUE empty_hash_alloc (VALUE klass)
 
VALUE rb_hash_new (void)
 
static VALUE hash_dup (VALUE hash, VALUE klass, VALUE flags)
 
VALUE rb_hash_dup (VALUE hash)
 
static void rb_hash_modify_check (VALUE hash)
 
static struct st_tablehash_tbl (VALUE hash)
 
struct st_tablerb_hash_tbl (VALUE hash)
 
struct st_tablerb_hash_tbl_raw (VALUE hash)
 
static void rb_hash_modify (VALUE hash)
 
 NORETURN (static void no_new_key(void))
 
static void no_new_key (void)
 
static int tbl_update (VALUE hash, VALUE key, tbl_update_func func, st_data_t optional_arg)
 
static void set_proc_default (VALUE hash, VALUE proc)
 
static VALUE rb_hash_initialize (int argc, VALUE *argv, VALUE hash)
 
static VALUE rb_hash_s_create (int argc, VALUE *argv, VALUE klass)
 
static VALUE to_hash (VALUE hash)
 
VALUE rb_check_hash_type (VALUE hash)
 
static int rb_hash_rehash_i (VALUE key, VALUE value, VALUE arg)
 
VALUE rb_hash_rehash (VALUE hash)
 
VALUE rb_hash_default_value (VALUE hash, VALUE key)
 
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)
 
static VALUE rb_hash_fetch_m (int argc, VALUE *argv, VALUE hash)
 
VALUE rb_hash_fetch (VALUE hash, VALUE key)
 
static VALUE rb_hash_default (int argc, VALUE *argv, VALUE hash)
 
static VALUE rb_hash_set_default (VALUE hash, VALUE ifnone)
 
static VALUE rb_hash_default_proc (VALUE hash)
 
VALUE rb_hash_set_default_proc (VALUE hash, VALUE proc)
 
static int key_i (VALUE key, VALUE value, VALUE arg)
 
static VALUE rb_hash_key (VALUE hash, VALUE value)
 
static VALUE rb_hash_index (VALUE hash, VALUE value)
 
VALUE rb_hash_delete_entry (VALUE hash, VALUE key)
 
VALUE rb_hash_delete (VALUE hash, VALUE key)
 
static VALUE rb_hash_delete_m (VALUE hash, VALUE key)
 
static int shift_i_safe (VALUE key, VALUE value, VALUE arg)
 
static VALUE rb_hash_shift (VALUE hash)
 
static int delete_if_i (VALUE key, VALUE value, VALUE hash)
 
static VALUE hash_enum_size (VALUE hash, VALUE args, VALUE eobj)
 
VALUE rb_hash_delete_if (VALUE hash)
 
VALUE rb_hash_reject_bang (VALUE hash)
 
static int reject_i (VALUE key, VALUE value, VALUE result)
 
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)
 
static int select_i (VALUE key, VALUE value, VALUE result)
 
VALUE rb_hash_select (VALUE hash)
 
static int keep_if_i (VALUE key, VALUE value, VALUE hash)
 
VALUE rb_hash_select_bang (VALUE hash)
 
VALUE rb_hash_keep_if (VALUE hash)
 
static int clear_i (VALUE key, VALUE value, VALUE dummy)
 
VALUE rb_hash_clear (VALUE hash)
 
static int hash_aset (st_data_t *key, st_data_t *val, struct update_arg *arg, int existing)
 
static int hash_aset_str (st_data_t *key, st_data_t *val, struct update_arg *arg, int existing)
 
VALUE rb_hash_aset (VALUE hash, VALUE key, VALUE val)
 
static int replace_i (VALUE key, VALUE val, VALUE hash)
 
static VALUE rb_hash_initialize_copy (VALUE hash, VALUE hash2)
 
static VALUE rb_hash_replace (VALUE hash, VALUE hash2)
 
VALUE rb_hash_size (VALUE hash)
 
static VALUE rb_hash_empty_p (VALUE hash)
 
static int each_value_i (VALUE key, VALUE value)
 
static VALUE rb_hash_each_value (VALUE hash)
 
static int each_key_i (VALUE key, VALUE value)
 
static VALUE rb_hash_each_key (VALUE hash)
 
static int each_pair_i (VALUE key, VALUE value)
 
static int each_pair_i_fast (VALUE key, VALUE value)
 
static VALUE rb_hash_each_pair (VALUE hash)
 
static int transform_values_i (VALUE key, VALUE value, VALUE result)
 
static VALUE rb_hash_transform_values (VALUE hash)
 
static VALUE rb_hash_transform_values_bang (VALUE hash)
 
static int to_a_i (VALUE key, VALUE value, VALUE ary)
 
static VALUE rb_hash_to_a (VALUE hash)
 
static int inspect_i (VALUE key, VALUE value, VALUE str)
 
static VALUE inspect_hash (VALUE hash, VALUE dummy, int recur)
 
static VALUE rb_hash_inspect (VALUE hash)
 
static VALUE rb_hash_to_hash (VALUE hash)
 
static VALUE rb_hash_to_h (VALUE hash)
 
static int keys_i (VALUE key, VALUE value, VALUE ary)
 
VALUE rb_hash_keys (VALUE hash)
 
static int values_i (VALUE key, VALUE value, VALUE ary)
 
VALUE rb_hash_values (VALUE hash)
 
VALUE rb_hash_has_key (VALUE hash, VALUE key)
 
static int rb_hash_search_value (VALUE key, VALUE value, VALUE arg)
 
static VALUE rb_hash_has_value (VALUE hash, VALUE val)
 
static int eql_i (VALUE key, VALUE val1, VALUE arg)
 
static VALUE recursive_eql (VALUE hash, VALUE dt, int recur)
 
static VALUE hash_equal (VALUE hash1, VALUE hash2, int eql)
 
static VALUE rb_hash_equal (VALUE hash1, VALUE hash2)
 
static VALUE rb_hash_eql (VALUE hash1, VALUE hash2)
 
static int hash_i (VALUE key, VALUE val, VALUE arg)
 
static VALUE rb_hash_hash (VALUE hash)
 
static int rb_hash_invert_i (VALUE key, VALUE value, VALUE hash)
 
static VALUE rb_hash_invert (VALUE hash)
 
static int rb_hash_update_callback (st_data_t *key, st_data_t *value, struct update_arg *arg, int existing)
 
static int rb_hash_update_i (VALUE key, VALUE value, VALUE hash)
 
static int rb_hash_update_block_callback (st_data_t *key, st_data_t *value, struct update_arg *arg, int existing)
 
static int rb_hash_update_block_i (VALUE key, VALUE value, VALUE hash)
 
static VALUE rb_hash_update (VALUE hash1, VALUE hash2)
 
static int rb_hash_update_func_callback (st_data_t *key, st_data_t *value, struct update_arg *arg, int existing)
 
static int rb_hash_update_func_i (VALUE key, VALUE value, VALUE arg0)
 
VALUE rb_hash_update_by (VALUE hash1, VALUE hash2, rb_hash_update_func *func)
 
static VALUE rb_hash_merge (VALUE hash1, VALUE hash2)
 
static int assoc_cmp (VALUE a, VALUE b)
 
static VALUE lookup2_call (VALUE arg)
 
static VALUE reset_hash_type (VALUE arg)
 
static int assoc_i (VALUE key, VALUE val, VALUE arg)
 
VALUE rb_hash_assoc (VALUE hash, VALUE key)
 
static int rassoc_i (VALUE key, VALUE val, VALUE arg)
 
VALUE rb_hash_rassoc (VALUE hash, VALUE obj)
 
static int flatten_i (VALUE key, VALUE val, VALUE ary)
 
static VALUE rb_hash_flatten (int argc, VALUE *argv, VALUE hash)
 
static int delete_if_nil (VALUE key, VALUE value, VALUE hash)
 
static int set_if_not_nil (VALUE key, VALUE value, VALUE hash)
 
static VALUE rb_hash_compact (VALUE hash)
 
static VALUE rb_hash_compact_bang (VALUE hash)
 
static VALUE rb_hash_compare_by_id (VALUE hash)
 
VALUE rb_hash_compare_by_id_p (VALUE hash)
 
VALUE rb_ident_hash_new (void)
 
st_tablerb_init_identtable (void)
 
st_tablerb_init_identtable_with_size (st_index_t size)
 
static int any_p_i (VALUE key, VALUE value, VALUE arg)
 
static int any_p_i_fast (VALUE key, VALUE value, VALUE arg)
 
static VALUE rb_hash_any_p (VALUE hash)
 
VALUE rb_hash_dig (int argc, VALUE *argv, VALUE self)
 
static int hash_le_i (VALUE key, VALUE value, VALUE arg)
 
static VALUE hash_le (VALUE hash1, VALUE hash2)
 
static VALUE rb_hash_le (VALUE hash, VALUE other)
 
static VALUE rb_hash_lt (VALUE hash, VALUE other)
 
static VALUE rb_hash_ge (VALUE hash, VALUE other)
 
static VALUE rb_hash_gt (VALUE hash, VALUE other)
 
static VALUE hash_proc_call (VALUE key, VALUE hash, int argc, const VALUE *argv, VALUE passed_proc)
 
static VALUE rb_hash_to_proc (VALUE hash)
 
static int add_new_i (st_data_t *key, st_data_t *val, st_data_t arg, int existing)
 
int rb_hash_add_new_element (VALUE hash, VALUE key, VALUE val)
 
static VALUE env_enc_str_new (const char *ptr, long len, rb_encoding *enc)
 
static VALUE env_enc_str_new_cstr (const char *ptr, rb_encoding *enc)
 
static VALUE env_str_new (const char *ptr, long len)
 
static VALUE env_str_new2 (const char *ptr)
 
static int env_path_tainted (const char *)
 
static rb_encodingenv_encoding_for (const char *name, const char *ptr)
 
static VALUE env_name_new (const char *name, const char *ptr)
 
static void * get_env_cstr (VALUE str, const char *name)
 
static const char * env_name (volatile VALUE *s)
 
static VALUE env_delete (VALUE obj, VALUE name)
 
static VALUE env_delete_m (VALUE obj, VALUE name)
 
static VALUE rb_f_getenv (VALUE obj, VALUE name)
 
static VALUE env_fetch (int argc, VALUE *argv)
 
static void path_tainted_p (const char *path)
 
int rb_env_path_tainted (void)
 
static int envix (const char *nam)
 
void ruby_setenv (const char *name, const char *value)
 
void ruby_unsetenv (const char *name)
 
static VALUE env_aset (VALUE obj, VALUE nm, VALUE val)
 
static VALUE env_keys (void)
 
static VALUE rb_env_size (VALUE ehash, VALUE args, VALUE eobj)
 
static VALUE env_each_key (VALUE ehash)
 
static VALUE env_values (void)
 
static VALUE env_each_value (VALUE ehash)
 
static VALUE env_each_pair (VALUE ehash)
 
static VALUE env_reject_bang (VALUE ehash)
 
static VALUE env_delete_if (VALUE ehash)
 
static VALUE env_values_at (int argc, VALUE *argv)
 
static VALUE env_select (VALUE ehash)
 
static VALUE env_select_bang (VALUE ehash)
 
static VALUE env_keep_if (VALUE ehash)
 
VALUE rb_env_clear (void)
 
static VALUE env_to_s (void)
 
static VALUE env_inspect (void)
 
static VALUE env_to_a (void)
 
static VALUE env_none (void)
 
static VALUE env_size (void)
 
static VALUE env_empty_p (void)
 
static VALUE env_has_key (VALUE env, VALUE key)
 
static VALUE env_assoc (VALUE env, VALUE key)
 
static VALUE env_has_value (VALUE dmy, VALUE obj)
 
static VALUE env_rassoc (VALUE dmy, VALUE obj)
 
static VALUE env_key (VALUE dmy, VALUE value)
 
static VALUE env_index (VALUE dmy, VALUE value)
 
static VALUE env_to_hash (void)
 
static VALUE env_reject (void)
 
static VALUE env_shift (void)
 
static VALUE env_invert (void)
 
static int env_replace_i (VALUE key, VALUE val, VALUE keys)
 
static VALUE env_replace (VALUE env, VALUE hash)
 
static int env_update_i (VALUE key, VALUE val)
 
static VALUE env_update (VALUE env, VALUE hash)
 
void Init_Hash (void)
 

Variables

VALUE rb_cHash
 
static VALUE envtbl
 
static ID id_hash
 
static ID id_yield
 
static ID id_default
 
static ID id_flatten_bang
 
static const uint64_t prime1 = ((uint64_t)0x2e0bb864 << 32) | 0xe9ea7df5
 
static const uint64_t prime2 = ((uint64_t)0xcdb32970 << 32) | 0x830fcaa1
 
static const struct st_hash_type objhash
 
static const struct st_hash_type identhash
 
static int path_tainted = -1
 
static char ** origenviron
 
char ** environ
 

Macro Definition Documentation

◆ COPY_DEFAULT

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

Definition at line 41 of file hash.c.

Referenced by rb_hash_initialize_copy(), and rb_hash_replace().

◆ env_name

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

Definition at line 3195 of file hash.c.

Referenced by env_assoc(), env_delete(), env_fetch(), env_has_key(), and rb_f_getenv().

◆ ENVMATCH

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

Definition at line 3083 of file hash.c.

Referenced by env_aset(), env_delete(), and env_encoding_for().

◆ ENVNMATCH

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

Definition at line 3084 of file hash.c.

Referenced by envix().

◆ FREE_ENVIRON

#define FREE_ENVIRON (   e)

◆ get_env_ptr

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

Definition at line 3182 of file hash.c.

Referenced by env_aset(), and env_name().

◆ GET_ENVIRON

#define GET_ENVIRON (   e)    (e)

◆ HAS_EXTRA_STATES

#define HAS_EXTRA_STATES (   hash,
  klass 
)
Value:
( \
((klass = has_extra_methods(rb_obj_class(hash))) != 0) || \
#define FL_EXIVAR
Definition: ruby.h:1222
static unsigned int hash(str, len) register const char *str
#define FL_TAINT
Definition: ruby.h:1220
#define RHASH_IFNONE(h)
Definition: ruby.h:1065
#define NIL_P(v)
Definition: ruby.h:451
#define HASH_PROC_DEFAULT
Definition: internal.h:1124
static VALUE has_extra_methods(VALUE klass)
Definition: hash.c:52
VALUE rb_obj_class(VALUE)
Definition: object.c:229

Definition at line 30 of file hash.c.

Referenced by rb_hash_reject().

◆ 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); \
}
static void no_new_key(void)
Definition: hash.c:504
SSL_METHOD *(* func)(void)
Definition: ossl_ssl.c:54
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
Definition: st.h:22
#define val

Definition at line 514 of file hash.c.

Referenced by hash_aset_str(), rb_hash_update_block_callback(), rb_hash_update_callback(), and rb_hash_update_func_callback().

◆ rb_ident_cmp

#define rb_ident_cmp   st_numcmp

Definition at line 280 of file hash.c.

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

Referenced by Init_Hash().

◆ RHASH_UPDATE

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

Definition at line 567 of file hash.c.

Referenced by rb_hash_update_block_i(), rb_hash_update_func_i(), and rb_hash_update_i().

◆ 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:561
SSL_METHOD *(* func)(void)
Definition: ossl_ssl.c:54
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
Definition: st.h:22

Definition at line 563 of file hash.c.

Referenced by rb_hash_aset().

◆ SET_DEFAULT

#define SET_DEFAULT (   hash,
  ifnone 
)
Value:
( \
FL_UNSET_RAW(hash, HASH_PROC_DEFAULT), \
RHASH_SET_IFNONE(hash, ifnone))
static unsigned int hash(str, len) register const char *str
#define HASH_PROC_DEFAULT
Definition: internal.h:1124

Definition at line 35 of file hash.c.

Referenced by rb_hash_set_default(), and rb_hash_set_default_proc().

◆ SET_PROC_DEFAULT

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

Definition at line 39 of file hash.c.

Referenced by rb_hash_initialize(), and rb_hash_set_default_proc().

◆ UPDATE_CALLBACK

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

Definition at line 561 of file hash.c.

Typedef Documentation

◆ rb_foreach_func

typedef int rb_foreach_func(VALUE, VALUE, VALUE)

Definition at line 339 of file hash.c.

◆ st_foreach_func

typedef int st_foreach_func(st_data_t, st_data_t, st_data_t)

Definition at line 304 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 537 of file hash.c.

Function Documentation

◆ add_new_i()

static int add_new_i ( st_data_t key,
st_data_t val,
st_data_t  arg,
int  existing 
)
static

Definition at line 3020 of file hash.c.

References Qundef, RB_OBJ_WRITE, RB_OBJ_WRITTEN, ST_CONTINUE, and ST_STOP.

Referenced by rb_hash_add_new_element().

◆ any_hash()

static long any_hash ( VALUE  a,
st_index_t(*)(VALUE other_func 
)
inlinestatic

◆ any_p_i()

static int any_p_i ( VALUE  key,
VALUE  value,
VALUE  arg 
)
static

Definition at line 2828 of file hash.c.

References Qtrue, rb_assoc_new(), rb_yield(), RTEST, ST_CONTINUE, and ST_STOP.

Referenced by rb_hash_any_p().

◆ any_p_i_fast()

static int any_p_i_fast ( VALUE  key,
VALUE  value,
VALUE  arg 
)
static

Definition at line 2839 of file hash.c.

References Qtrue, rb_yield_values(), RTEST, ST_CONTINUE, and ST_STOP.

Referenced by rb_hash_any_p().

◆ assoc_cmp()

static int assoc_cmp ( VALUE  a,
VALUE  b 
)
static

Definition at line 2521 of file hash.c.

References rb_equal(), and RTEST.

Referenced by rb_hash_assoc().

◆ assoc_i()

static int assoc_i ( VALUE  key,
VALUE  val,
VALUE  arg 
)
static

Definition at line 2547 of file hash.c.

References rb_assoc_new(), rb_equal(), RTEST, ST_CONTINUE, and ST_STOP.

Referenced by rb_hash_assoc().

◆ clear_i()

static int clear_i ( VALUE  key,
VALUE  value,
VALUE  dummy 
)
static

Definition at line 1489 of file hash.c.

References ST_DELETE.

Referenced by rb_hash_clear().

◆ copy_default()

static void copy_default ( struct RHash hash,
const struct RHash hash2 
)
inlinestatic

Definition at line 44 of file hash.c.

References RHash::basic, RBasic::flags, HASH_PROC_DEFAULT, RHASH_IFNONE, and RHASH_SET_IFNONE.

◆ delete_if_i()

static int delete_if_i ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 1242 of file hash.c.

References rb_yield_values(), RTEST, ST_CONTINUE, and ST_DELETE.

Referenced by rb_hash_delete_if(), and rb_hash_reject_bang().

◆ delete_if_nil()

static int delete_if_nil ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 2697 of file hash.c.

References NIL_P, ST_CONTINUE, and ST_DELETE.

Referenced by rb_hash_compact_bang().

◆ each_key_i()

static int each_key_i ( VALUE  key,
VALUE  value 
)
static

Definition at line 1735 of file hash.c.

References rb_yield(), and ST_CONTINUE.

Referenced by rb_hash_each_key().

◆ each_pair_i()

static int each_pair_i ( VALUE  key,
VALUE  value 
)
static

Definition at line 1768 of file hash.c.

References rb_assoc_new(), rb_yield(), and ST_CONTINUE.

Referenced by rb_hash_each_pair().

◆ each_pair_i_fast()

static int each_pair_i_fast ( VALUE  key,
VALUE  value 
)
static

Definition at line 1775 of file hash.c.

References argv, key, rb_yield_values2(), and ST_CONTINUE.

Referenced by rb_hash_each_pair().

◆ each_value_i()

static int each_value_i ( VALUE  key,
VALUE  value 
)
static

Definition at line 1701 of file hash.c.

References rb_yield(), and ST_CONTINUE.

Referenced by rb_hash_each_value().

◆ empty_hash_alloc()

static VALUE empty_hash_alloc ( VALUE  klass)
static

Definition at line 433 of file hash.c.

References hash_alloc(), and RUBY_DTRACE_CREATE_HOOK.

Referenced by Init_Hash().

◆ env_aset()

static VALUE env_aset ( VALUE  obj,
VALUE  nm,
VALUE  val 
)
static

◆ env_assoc()

static VALUE env_assoc ( VALUE  env,
VALUE  key 
)
static

Definition at line 4064 of file hash.c.

References env_name, env_str_new2(), getenv, Qnil, and rb_assoc_new().

Referenced by Init_Hash().

◆ env_delete()

static VALUE env_delete ( VALUE  obj,
VALUE  name 
)
static

◆ env_delete_if()

static VALUE env_delete_if ( VALUE  ehash)
static

Definition at line 3775 of file hash.c.

References env_reject_bang(), envtbl, rb_env_size(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Hash().

◆ env_delete_m()

static VALUE env_delete_m ( VALUE  obj,
VALUE  name 
)
static

Definition at line 3227 of file hash.c.

References env_delete(), NIL_P, rb_block_given_p(), rb_yield(), and val.

Referenced by Init_Hash().

◆ env_each_key()

static VALUE env_each_key ( VALUE  ehash)
static

Definition at line 3625 of file hash.c.

References env_keys(), RARRAY_AREF, RARRAY_LEN, rb_env_size(), rb_yield(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Hash().

◆ env_each_pair()

static VALUE env_each_pair ( VALUE  ehash)
static

◆ env_each_value()

static VALUE env_each_value ( VALUE  ehash)
static

Definition at line 3673 of file hash.c.

References env_values(), RARRAY_AREF, RARRAY_LEN, rb_env_size(), rb_yield(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Hash().

◆ env_empty_p()

static VALUE env_empty_p ( void  )
static

Definition at line 4024 of file hash.c.

References env, FREE_ENVIRON, GET_ENVIRON, Qfalse, and Qtrue.

Referenced by Init_Hash().

◆ env_enc_str_new()

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

◆ env_enc_str_new_cstr()

static VALUE env_enc_str_new_cstr ( const char *  ptr,
rb_encoding enc 
)
static

Definition at line 3111 of file hash.c.

References env_enc_str_new(), and strlen().

Referenced by env_name_new().

◆ env_encoding_for()

static rb_encoding* env_encoding_for ( const char *  name,
const char *  ptr 
)
static

Definition at line 3132 of file hash.c.

References env_path_tainted(), ENVMATCH, PATH_ENV, rb_filesystem_encoding(), and rb_locale_encoding().

Referenced by env_name_new().

◆ env_fetch()

static VALUE env_fetch ( int  argc,
VALUE argv 
)
static

◆ env_has_key()

static VALUE env_has_key ( VALUE  env,
VALUE  key 
)
static

Definition at line 4047 of file hash.c.

References env_name, getenv, Qfalse, and Qtrue.

Referenced by Init_Hash().

◆ env_has_value()

static VALUE env_has_value ( VALUE  dmy,
VALUE  obj 
)
static

◆ env_index()

static VALUE env_index ( VALUE  dmy,
VALUE  value 
)
static

Definition at line 4175 of file hash.c.

References env_key(), and rb_warn().

Referenced by Init_Hash().

◆ env_inspect()

static VALUE env_inspect ( void  )
static

◆ env_invert()

static VALUE env_invert ( void  )
static

Definition at line 4258 of file hash.c.

References env_to_hash(), and rb_hash_invert().

Referenced by Init_Hash().

◆ env_keep_if()

static VALUE env_keep_if ( VALUE  ehash)
static

Definition at line 3877 of file hash.c.

References env_select_bang(), envtbl, rb_env_size(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Hash().

◆ env_key()

static VALUE env_key ( VALUE  dmy,
VALUE  value 
)
static

Definition at line 4145 of file hash.c.

References env, env_str_new(), FREE_ENVIRON, GET_ENVIRON, len, Qnil, RSTRING_LEN, RSTRING_PTR, SafeStringValue, strchr(), and strlen().

Referenced by env_index(), and Init_Hash().

◆ env_keys()

static VALUE env_keys ( void  )
static

◆ env_name()

static const char* env_name ( volatile VALUE s)
inlinestatic

Definition at line 3187 of file hash.c.

References get_env_ptr, name, and SafeStringValue.

◆ env_name_new()

static VALUE env_name_new ( const char *  name,
const char *  ptr 
)
static

Definition at line 3143 of file hash.c.

References env_enc_str_new_cstr(), and env_encoding_for().

Referenced by env_fetch(), and rb_f_getenv().

◆ env_none()

static VALUE env_none ( void  )
static

Definition at line 3992 of file hash.c.

References Qnil.

Referenced by Init_Hash().

◆ env_path_tainted()

static int env_path_tainted ( const char *  path)
static

Definition at line 3302 of file hash.c.

References path_tainted, and path_tainted_p().

Referenced by env_encoding_for(), and env_str_new2().

◆ env_rassoc()

static VALUE env_rassoc ( VALUE  dmy,
VALUE  obj 
)
static

◆ env_reject()

static VALUE env_reject ( void  )
static

Definition at line 4218 of file hash.c.

References env_to_hash(), and rb_hash_delete_if().

Referenced by Init_Hash().

◆ env_reject_bang()

static VALUE env_reject_bang ( VALUE  ehash)
static

◆ env_replace()

static VALUE env_replace ( VALUE  env,
VALUE  hash 
)
static

Definition at line 4281 of file hash.c.

References env, env_delete(), env_keys(), env_replace_i(), RARRAY_AREF, RARRAY_LEN, RB_GC_GUARD, rb_hash_foreach(), and to_hash().

Referenced by Init_Hash().

◆ env_replace_i()

static int env_replace_i ( VALUE  key,
VALUE  val,
VALUE  keys 
)
static

Definition at line 4264 of file hash.c.

References env_aset(), Qnil, rb_ary_delete(), rb_ary_includes(), and ST_CONTINUE.

Referenced by env_replace().

◆ env_select()

static VALUE env_select ( VALUE  ehash)
static

◆ env_select_bang()

static VALUE env_select_bang ( VALUE  ehash)
static

◆ env_shift()

static VALUE env_shift ( void  )
static

◆ env_size()

static VALUE env_size ( void  )
static

Definition at line 4005 of file hash.c.

References env, FREE_ENVIRON, GET_ENVIRON, and INT2FIX.

Referenced by Init_Hash(), vm_env_new(), and vm_make_env_each().

◆ env_str_new()

static VALUE env_str_new ( const char *  ptr,
long  len 
)
static

◆ env_str_new2()

static VALUE env_str_new2 ( const char *  ptr)
static

◆ env_to_a()

static VALUE env_to_a ( void  )
static

◆ env_to_hash()

static VALUE env_to_hash ( void  )
static

◆ env_to_s()

static VALUE env_to_s ( void  )
static

Definition at line 3914 of file hash.c.

References rb_usascii_str_new2.

Referenced by Init_Hash().

◆ env_update()

static VALUE env_update ( VALUE  env,
VALUE  hash 
)
static

Definition at line 4319 of file hash.c.

References env, env_update_i(), rb_hash_foreach(), and to_hash().

Referenced by Init_Hash().

◆ env_update_i()

static int env_update_i ( VALUE  key,
VALUE  val 
)
static

Definition at line 4299 of file hash.c.

References env_aset(), Qnil, rb_block_given_p(), rb_f_getenv(), rb_yield_values(), and ST_CONTINUE.

Referenced by env_update().

◆ env_values()

static VALUE env_values ( void  )
static

Definition at line 3645 of file hash.c.

References env, env_str_new2(), FREE_ENVIRON, GET_ENVIRON, rb_ary_new(), rb_ary_push(), and strchr().

Referenced by env_each_value(), and Init_Hash().

◆ env_values_at()

static VALUE env_values_at ( int  argc,
VALUE argv 
)
static

Definition at line 3790 of file hash.c.

References argc, Qnil, rb_ary_new(), rb_ary_push(), rb_f_getenv(), and result.

Referenced by Init_Hash().

◆ envix()

static int envix ( const char *  nam)
static

Definition at line 3332 of file hash.c.

References env, ENVNMATCH, FREE_ENVIRON, GET_ENVIRON, len, name, NORETURN(), rb_sprintf(), rb_syserr_fail_str(), strchr(), and strlen().

Referenced by ruby_setenv().

◆ eql_i()

static int eql_i ( VALUE  key,
VALUE  val1,
VALUE  arg 
)
static

◆ flatten_i()

static int flatten_i ( VALUE  key,
VALUE  val,
VALUE  ary 
)
static

Definition at line 2642 of file hash.c.

References key, rb_ary_cat(), ST_CONTINUE, and val.

Referenced by rb_hash_flatten().

◆ foreach_safe_i()

static int foreach_safe_i ( st_data_t  key,
st_data_t  value,
st_data_t  args,
int  error 
)
static

Definition at line 313 of file hash.c.

References foreach_safe_arg::arg, foreach_safe_arg::func, ST_CHECK, ST_CONTINUE, and ST_STOP.

Referenced by st_foreach_safe().

◆ get_env_cstr()

static void* get_env_cstr ( VALUE  str,
const char *  name 
)
static

◆ has_extra_methods()

static VALUE has_extra_methods ( VALUE  klass)
static

Definition at line 52 of file hash.c.

References rb_cHash, rb_class_has_methods(), rb_hash_s_try_convert(), and RCLASS_SUPER.

◆ hash_alloc()

static VALUE hash_alloc ( VALUE  klass)
static

Definition at line 427 of file hash.c.

References hash_alloc_flags(), and Qnil.

Referenced by empty_hash_alloc(), rb_hash_new(), rb_hash_rehash(), and rb_hash_s_create().

◆ hash_alloc_flags()

static VALUE hash_alloc_flags ( VALUE  klass,
VALUE  flags,
VALUE  ifnone 
)
static

Definition at line 416 of file hash.c.

References FL_WB_PROTECTED, hash(), NEWOBJ_OF, RGENGC_WB_PROTECTED_HASH, RHASH_SET_IFNONE, and T_HASH.

Referenced by hash_alloc(), and hash_dup().

◆ hash_aset()

static int hash_aset ( st_data_t key,
st_data_t val,
struct update_arg arg,
int  existing 
)
static

◆ hash_aset_str()

static int hash_aset_str ( st_data_t key,
st_data_t val,
struct update_arg arg,
int  existing 
)
static

Definition at line 1537 of file hash.c.

References hash_aset(), NOINSERT_UPDATE_CALLBACK, and rb_str_new_frozen().

Referenced by rb_hash_aset().

◆ hash_dup()

static VALUE hash_dup ( VALUE  hash,
VALUE  klass,
VALUE  flags 
)
static

Definition at line 447 of file hash.c.

References hash_alloc_flags(), RHASH, RHASH_EMPTY_P, RHASH_IFNONE, and st_copy.

Referenced by rb_hash_dup(), and rb_hash_to_h().

◆ hash_enum_size()

static VALUE hash_enum_size ( VALUE  hash,
VALUE  args,
VALUE  eobj 
)
static

◆ hash_equal()

static VALUE hash_equal ( VALUE  hash1,
VALUE  hash2,
int  eql 
)
static

◆ hash_foreach_call()

static VALUE hash_foreach_call ( VALUE  arg)
static

Definition at line 392 of file hash.c.

References hash(), hash_foreach_iter(), Qnil, Qundef, rb_eRuntimeError, rb_raise(), RHASH, st_data_t, and st_foreach_check().

Referenced by rb_hash_foreach().

◆ hash_foreach_ensure()

static VALUE hash_foreach_ensure ( VALUE  hash)
static

Definition at line 380 of file hash.c.

References FL_TEST, FL_UNSET, HASH_DELETED, Qundef, RHASH, RHASH_ITER_LEV, st_cleanup_safe, and st_data_t.

Referenced by Init_Hash(), and rb_hash_foreach().

◆ hash_foreach_ensure_rollback()

static VALUE hash_foreach_ensure_rollback ( VALUE  hash)
static

Definition at line 373 of file hash.c.

References RHASH_ITER_LEV.

Referenced by Init_Hash().

◆ hash_foreach_iter()

static int hash_foreach_iter ( st_data_t  key,
st_data_t  value,
st_data_t  argp,
int  error 
)
static

◆ hash_i()

static int hash_i ( VALUE  key,
VALUE  val,
VALUE  arg 
)
static

Definition at line 2273 of file hash.c.

References hval, rb_hash(), ST_CONTINUE, and st_hash().

Referenced by rb_hash_hash().

◆ hash_le()

static VALUE hash_le ( VALUE  hash1,
VALUE  hash2 
)
static

Definition at line 2913 of file hash.c.

References hash_le_i(), Qtrue, and rb_hash_foreach().

Referenced by rb_hash_ge(), rb_hash_gt(), rb_hash_le(), and rb_hash_lt().

◆ hash_le_i()

static int hash_le_i ( VALUE  key,
VALUE  value,
VALUE  arg 
)
static

Definition at line 2903 of file hash.c.

References Qfalse, Qundef, rb_equal(), rb_hash_lookup2(), ST_CONTINUE, and ST_STOP.

Referenced by hash_le().

◆ hash_proc_call()

static VALUE hash_proc_call ( VALUE  key,
VALUE  hash,
int  argc,
const VALUE argv,
VALUE  passed_proc 
)
static

Definition at line 3007 of file hash.c.

References rb_check_arity, and rb_hash_aref().

Referenced by rb_hash_to_proc().

◆ hash_recursive()

static VALUE hash_recursive ( VALUE  obj,
VALUE  arg,
int  recurse 
)
static

Definition at line 119 of file hash.c.

References id_hash, INT2FIX, and rb_funcallv.

Referenced by rb_hash().

◆ hash_tbl()

static struct st_table* hash_tbl ( VALUE  hash)
static

Definition at line 474 of file hash.c.

References RHASH, and st_init_table.

Referenced by rb_hash_aset(), rb_hash_modify(), rb_hash_replace(), rb_hash_tbl(), and rb_hash_tbl_raw().

◆ Init_Hash()

void Init_Hash ( void  )

Definition at line 4441 of file hash.c.

References empty_hash_alloc(), env_aset(), env_assoc(), env_delete_if(), env_delete_m(), env_each_key(), env_each_pair(), env_each_value(), env_empty_p(), env_fetch(), env_has_key(), env_has_value(), env_index(), env_inspect(), env_invert(), env_keep_if(), env_key(), env_keys(), env_none(), env_rassoc(), env_reject(), env_reject_bang(), env_replace(), env_select(), env_select_bang(), env_shift(), env_size(), env_to_a(), env_to_hash(), env_to_s(), env_update(), env_values(), env_values_at(), environ, envtbl, hash_foreach_ensure(), hash_foreach_ensure_rollback(), id_default, id_flatten_bang, id_hash, id_yield, rb_cHash, rb_cObject, rb_define_alias(), rb_define_alloc_func(), rb_define_class(), rb_define_global_const(), rb_define_method(), rb_define_singleton_method(), rb_env_clear(), rb_extend_object(), rb_f_getenv(), rb_hash_any_p(), rb_hash_aref(), rb_hash_aset(), rb_hash_assoc(), rb_hash_clear(), rb_hash_compact(), rb_hash_compact_bang(), rb_hash_compare_by_id(), rb_hash_compare_by_id_p(), rb_hash_default(), rb_hash_default_proc(), rb_hash_delete_if(), rb_hash_delete_m(), rb_hash_dig(), rb_hash_each_key(), rb_hash_each_pair(), rb_hash_each_value(), rb_hash_empty_p(), rb_hash_eql(), rb_hash_equal(), rb_hash_fetch_m(), rb_hash_fetch_values(), rb_hash_flatten(), rb_hash_ge(), rb_hash_gt(), rb_hash_has_key(), rb_hash_has_value(), rb_hash_hash(), rb_hash_index(), rb_hash_initialize(), rb_hash_initialize_copy(), rb_hash_inspect(), rb_hash_invert(), rb_hash_keep_if(), rb_hash_key(), rb_hash_keys(), rb_hash_le(), rb_hash_lt(), rb_hash_merge(), rb_hash_rassoc(), rb_hash_rehash(), rb_hash_reject(), rb_hash_reject_bang(), rb_hash_replace(), rb_hash_s_create(), rb_hash_s_try_convert(), rb_hash_select(), rb_hash_select_bang(), rb_hash_set_default(), rb_hash_set_default_proc(), rb_hash_shift(), rb_hash_size(), rb_hash_to_a(), rb_hash_to_h(), rb_hash_to_hash(), rb_hash_to_proc(), rb_hash_transform_values(), rb_hash_transform_values_bang(), rb_hash_update(), rb_hash_values(), rb_hash_values_at(), rb_include_module(), rb_intern, rb_mEnumerable, rb_obj_alloc(), and ruby_register_rollback_func_for_ensure().

◆ inspect_hash()

static VALUE inspect_hash ( VALUE  hash,
VALUE  dummy,
int  recur 
)
static

◆ inspect_i()

static int inspect_i ( VALUE  key,
VALUE  value,
VALUE  str 
)
static

◆ keep_if_i()

static int keep_if_i ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 1434 of file hash.c.

References rb_yield_values(), RTEST, ST_CONTINUE, and ST_DELETE.

Referenced by rb_hash_keep_if(), and rb_hash_select_bang().

◆ key64_hash()

static uint64_t key64_hash ( uint64_t  key,
uint32_t  seed 
)
inlinestatic

Definition at line 245 of file hash.c.

References mult_and_mix().

Referenced by rb_ident_hash(), and rb_objid_hash().

◆ key_i()

static int key_i ( VALUE  key,
VALUE  value,
VALUE  arg 
)
static

Definition at line 1060 of file hash.c.

References key, rb_equal(), ST_CONTINUE, and ST_STOP.

Referenced by rb_hash_key().

◆ keys_i()

static int keys_i ( VALUE  key,
VALUE  value,
VALUE  ary 
)
static

Definition at line 1998 of file hash.c.

References rb_ary_push(), and ST_CONTINUE.

Referenced by rb_hash_keys().

◆ lookup2_call()

static VALUE lookup2_call ( VALUE  arg)
static

Definition at line 2527 of file hash.c.

References Qundef, and rb_hash_lookup2().

Referenced by rb_hash_assoc().

◆ mult_and_mix()

static uint64_t mult_and_mix ( uint64_t  m1,
uint64_t  m2 
)
inlinestatic

Definition at line 228 of file hash.c.

Referenced by key64_hash().

◆ no_new_key()

static void no_new_key ( void  )
static

Definition at line 504 of file hash.c.

References rb_eRuntimeError, and rb_raise().

Referenced by rb_hash_aset(), and rb_hash_modify().

◆ NORETURN()

NORETURN ( static void   no_new_keyvoid)

Referenced by envix(), and rb_hash_modify().

◆ obj_any_hash()

static st_index_t obj_any_hash ( VALUE  obj)
static

Definition at line 206 of file hash.c.

References FIX2LONG, and rb_hash().

Referenced by rb_any_hash().

◆ objid_hash()

static st_index_t objid_hash ( VALUE  obj)
static

Definition at line 257 of file hash.c.

References rb_objid_hash().

Referenced by rb_obj_hash().

◆ path_tainted_p()

static void path_tainted_p ( const char *  path)
static

Definition at line 3296 of file hash.c.

References rb_path_check().

Referenced by env_aset(), env_path_tainted(), and rb_env_path_tainted().

◆ rassoc_i()

static int rassoc_i ( VALUE  key,
VALUE  val,
VALUE  arg 
)
static

Definition at line 2606 of file hash.c.

References rb_assoc_new(), rb_equal(), RTEST, ST_CONTINUE, and ST_STOP.

Referenced by rb_hash_rassoc().

◆ rb_any_cmp()

static int rb_any_cmp ( VALUE  a,
VALUE  b 
)
static

Definition at line 100 of file hash.c.

References FIXNUM_P, Qundef, rb_cString, rb_eql(), rb_str_hash_cmp(), RB_TYPE_P, RBASIC, SYMBOL_P, and T_STRING.

◆ rb_any_hash()

static st_index_t rb_any_hash ( VALUE  a)
static

Definition at line 213 of file hash.c.

References any_hash(), and obj_any_hash().

◆ rb_check_hash_type()

VALUE rb_check_hash_type ( VALUE  hash)

◆ rb_dbl_long_hash()

long rb_dbl_long_hash ( double  d)

Definition at line 149 of file hash.c.

References rb_hash_start(), rb_memhash(), and rb_objid_hash().

Referenced by any_hash(), and rb_dbl_hash().

◆ rb_env_clear()

VALUE rb_env_clear ( void  )

Definition at line 3891 of file hash.c.

References env_delete(), env_keys(), envtbl, NIL_P, Qnil, RARRAY_AREF, RARRAY_LEN, rb_f_getenv(), RB_GC_GUARD, and val.

Referenced by Init_Hash(), and rb_execarg_run_options().

◆ rb_env_path_tainted()

int rb_env_path_tainted ( void  )

Definition at line 3311 of file hash.c.

References env, getenv, PATH_ENV, path_tainted, and path_tainted_p().

Referenced by security().

◆ rb_env_size()

static VALUE rb_env_size ( VALUE  ehash,
VALUE  args,
VALUE  eobj 
)
static

◆ rb_f_getenv()

static VALUE rb_f_getenv ( VALUE  obj,
VALUE  name 
)
static

◆ rb_hash()

VALUE rb_hash ( VALUE  obj)

◆ rb_hash_add_new_element()

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

Definition at line 3034 of file hash.c.

References add_new_i(), hash(), rb_hash_tbl_raw(), st_update(), and val.

Referenced by ary_add_hash(), ary_add_hash_by(), lazy_uniq_i(), uniq_func(), and uniq_iter().

◆ rb_hash_any_p()

static VALUE rb_hash_any_p ( VALUE  hash)
static

◆ rb_hash_aref()

VALUE rb_hash_aref ( VALUE  hash,
VALUE  key 
)

◆ rb_hash_aset()

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

Definition at line 1576 of file hash.c.

References hash_aset(), hash_aset_str(), hash_tbl(), no_new_key(), rb_cString, rb_hash_modify(), rb_obj_class(), RHASH, RHASH_ITER_LEV, RHASH_UPDATE_ITER, st_table::type, and val.

Referenced by add_activated_refinement(), args_kw_argv_to_hash(), args_setup_kw_parameters(), args_stored_kw_argv_to_hash(), cdhash_set_label_i(), check_exec_fds(), check_exec_fds_1(), check_exec_options_i_extract(), collect_values_of_values(), core_hash_merge(), count_imemo_objects_i(), count_nodes(), count_objects(), count_objects_size(), count_symbols(), coverage(), coverage_peek_result_i(), cState_to_h(), cto_i(), debug_lines(), dsymbol_alloc(), enum_to_h_i(), env_select(), env_to_hash(), etc_systmpdir(), fdbm_invert(), fdbm_to_hash(), fgdbm_invert(), fgdbm_to_hash(), fsdbm_invert(), fsdbm_to_hash(), gc_profile_record_get(), group_by_i(), handle_interrupt_arg_check_i(), ibf_load_object_hash(), Init_GC(), Init_Hash(), Init_ossl_asn1(), Init_ossl_x509name(), io_s_write(), iseq_build_from_ary_body(), iseq_data_to_ary(), JSON_parse_object(), kwmerge_i(), make_rest_kw_hash(), match_named_captures_iter(), mString_to_json_raw_object(), ole_const_load(), olerecord_ivar_set(), olerecord_set_ivar(), ossl_dh_get_params(), ossl_dsa_get_params(), ossl_rsa_get_params(), ossl_sslctx_get_session_cache_stats(), parser_set_compile_option_flag(), pruby_register_instance(), r_object0(), rb_ary_to_h(), rb_during_gc(), rb_econv_prepare_options(), rb_enc_aliases_enc_i(), rb_hash_invert_i(), rb_hash_s_create(), rb_inflate_add_dictionary(), rb_mod_refine(), rb_struct_to_h(), rb_thread_variable_set(), rb_uninterruptible(), rb_using_refinement(), rb_vm_add_root_module(), reachable_object_from_root_i(), realpath_rec(), recursive_list_access(), recursive_push(), reg_named_captures_iter(), reject_i(), replace_i(), ripper_init_eventids1_table(), ripper_init_eventids2_table(), select_i(), separate_symbol(), set_if_not_nil(), set_state_ivars(), set_zero(), set_zero_i(), setup_gc_stat_symbols(), sig_list(), tr_setup_table(), tr_trans(), tracepoint_stat_event_hooks(), transform_values_i(), vm_caller_setup_arg_block(), vm_caller_setup_arg_kw(), when_vals(), and yycompile0().

◆ rb_hash_assoc()

VALUE rb_hash_assoc ( VALUE  hash,
VALUE  key 
)

◆ rb_hash_clear()

VALUE rb_hash_clear ( VALUE  hash)

◆ rb_hash_compact()

static VALUE rb_hash_compact ( VALUE  hash)
static

Definition at line 2727 of file hash.c.

References rb_hash_foreach(), rb_hash_new(), result, RHASH_EMPTY_P, and set_if_not_nil().

Referenced by Init_Hash().

◆ rb_hash_compact_bang()

static VALUE rb_hash_compact_bang ( VALUE  hash)
static

Definition at line 2749 of file hash.c.

References delete_if_nil(), hash(), Qnil, rb_hash_foreach(), rb_hash_modify_check(), and RHASH.

Referenced by Init_Hash().

◆ rb_hash_compare_by_id()

static VALUE rb_hash_compare_by_id ( VALUE  hash)
static

Definition at line 2778 of file hash.c.

References hash(), identhash, rb_hash_compare_by_id_p(), rb_hash_modify(), rb_hash_rehash(), and RHASH.

Referenced by Init_Hash().

◆ rb_hash_compare_by_id_p()

VALUE rb_hash_compare_by_id_p ( VALUE  hash)

Definition at line 2797 of file hash.c.

References Qfalse, Qtrue, and RHASH.

Referenced by Init_Hash(), and rb_hash_compare_by_id().

◆ rb_hash_default()

static VALUE rb_hash_default ( int  argc,
VALUE argv,
VALUE  hash 
)
static

Definition at line 958 of file hash.c.

References FL_TEST, hash(), HASH_PROC_DEFAULT, id_yield, Qnil, rb_check_arity, rb_funcallv, and RHASH_IFNONE.

Referenced by Init_Hash().

◆ rb_hash_default_proc()

static VALUE rb_hash_default_proc ( VALUE  hash)
static

Definition at line 1017 of file hash.c.

References FL_TEST, HASH_PROC_DEFAULT, Qnil, and RHASH_IFNONE.

Referenced by Init_Hash().

◆ rb_hash_default_value()

VALUE rb_hash_default_value ( VALUE  hash,
VALUE  key 
)

◆ rb_hash_delete()

VALUE rb_hash_delete ( VALUE  hash,
VALUE  key 
)

Definition at line 1138 of file hash.c.

References Qnil, Qundef, and rb_hash_delete_entry().

Referenced by pruby_unregister_instance().

◆ rb_hash_delete_entry()

VALUE rb_hash_delete_entry ( VALUE  hash,
VALUE  key 
)

◆ rb_hash_delete_if()

VALUE rb_hash_delete_if ( VALUE  hash)

◆ rb_hash_delete_m()

static VALUE rb_hash_delete_m ( VALUE  hash,
VALUE  key 
)
static

Definition at line 1169 of file hash.c.

References Qnil, Qundef, rb_block_given_p(), rb_hash_delete_entry(), rb_hash_modify_check(), rb_yield(), and val.

Referenced by Init_Hash().

◆ rb_hash_dig()

VALUE rb_hash_dig ( int  argc,
VALUE argv,
VALUE  self 
)

Definition at line 2893 of file hash.c.

References argv, Qnil, rb_check_arity, rb_hash_aref(), rb_obj_dig(), and UNLIMITED_ARGUMENTS.

Referenced by Init_Hash().

◆ rb_hash_dup()

VALUE rb_hash_dup ( VALUE  hash)

◆ rb_hash_each_key()

static VALUE rb_hash_each_key ( VALUE  hash)
static

Definition at line 1760 of file hash.c.

References each_key_i(), hash(), hash_enum_size(), rb_hash_foreach(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Hash().

◆ rb_hash_each_pair()

static VALUE rb_hash_each_pair ( VALUE  hash)
static

◆ rb_hash_each_value()

static VALUE rb_hash_each_value ( VALUE  hash)
static

Definition at line 1727 of file hash.c.

References each_value_i(), hash(), hash_enum_size(), rb_hash_foreach(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Hash().

◆ rb_hash_empty_p()

static VALUE rb_hash_empty_p ( VALUE  hash)
static

Definition at line 1695 of file hash.c.

References Qfalse, Qtrue, and RHASH_EMPTY_P.

Referenced by Init_Hash().

◆ rb_hash_eql()

static VALUE rb_hash_eql ( VALUE  hash1,
VALUE  hash2 
)
static

Definition at line 2267 of file hash.c.

References hash_equal(), and TRUE.

Referenced by Init_Hash().

◆ rb_hash_equal()

static VALUE rb_hash_equal ( VALUE  hash1,
VALUE  hash2 
)
static

Definition at line 2252 of file hash.c.

References FALSE, and hash_equal().

Referenced by Init_Hash().

◆ rb_hash_fetch()

VALUE rb_hash_fetch ( VALUE  hash,
VALUE  key 
)

Definition at line 931 of file hash.c.

References rb_hash_fetch_m().

Referenced by olerecord_ivar_get(), olerecord_ivar_set(), and rb_hash_fetch_values().

◆ rb_hash_fetch_m()

static VALUE rb_hash_fetch_m ( int  argc,
VALUE argv,
VALUE  hash 
)
static

◆ rb_hash_fetch_values()

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

Definition at line 1386 of file hash.c.

References argc, rb_ary_new2, rb_ary_push(), rb_hash_fetch(), and result.

Referenced by Init_Hash().

◆ rb_hash_flatten()

static VALUE rb_hash_flatten ( int  argc,
VALUE argv,
VALUE  hash 
)
static

◆ rb_hash_foreach()

void rb_hash_foreach ( VALUE  hash,
int(*)(ANYARGS func,
VALUE  farg 
)

◆ rb_hash_freeze()

VALUE rb_hash_freeze ( VALUE  hash)

Definition at line 76 of file hash.c.

References rb_obj_freeze().

Referenced by rb_coverage_peek_result(), and rb_econv_prepare_options().

◆ rb_hash_ge()

static VALUE rb_hash_ge ( VALUE  hash,
VALUE  other 
)
static

Definition at line 2978 of file hash.c.

References hash_le(), Qfalse, RHASH_SIZE, and to_hash().

Referenced by Init_Hash().

◆ rb_hash_gt()

static VALUE rb_hash_gt ( VALUE  hash,
VALUE  other 
)
static

Definition at line 2999 of file hash.c.

References hash_le(), Qfalse, RHASH_SIZE, and to_hash().

Referenced by Init_Hash().

◆ rb_hash_has_key()

VALUE rb_hash_has_key ( VALUE  hash,
VALUE  key 
)

Definition at line 2105 of file hash.c.

References Qfalse, Qtrue, RHASH, and st_lookup.

Referenced by Init_Hash().

◆ rb_hash_has_value()

static VALUE rb_hash_has_value ( VALUE  hash,
VALUE  val 
)
static

Definition at line 2141 of file hash.c.

References Qfalse, rb_hash_foreach(), rb_hash_search_value(), and val.

Referenced by Init_Hash().

◆ rb_hash_hash()

static VALUE rb_hash_hash ( VALUE  hash)
static

Definition at line 2295 of file hash.c.

References hash_i(), hval, rb_hash_end(), rb_hash_foreach(), rb_hash_start(), rb_hash_uint(), RHASH_SIZE, size, and ST2FIX.

Referenced by Init_Hash().

◆ rb_hash_ifnone()

VALUE rb_hash_ifnone ( VALUE  h)

Definition at line 87 of file hash.c.

References RHASH_IFNONE.

◆ rb_hash_index()

static VALUE rb_hash_index ( VALUE  hash,
VALUE  value 
)
static

Definition at line 1100 of file hash.c.

References rb_hash_key(), and rb_warn().

Referenced by Init_Hash().

◆ rb_hash_initialize()

static VALUE rb_hash_initialize ( int  argc,
VALUE argv,
VALUE  hash 
)
static

◆ rb_hash_initialize_copy()

static VALUE rb_hash_initialize_copy ( VALUE  hash,
VALUE  hash2 
)
static

◆ rb_hash_inspect()

static VALUE rb_hash_inspect ( VALUE  hash)
static

Definition at line 1959 of file hash.c.

References inspect_hash(), rb_exec_recursive(), rb_usascii_str_new2, and RHASH_EMPTY_P.

Referenced by Init_Hash().

◆ rb_hash_invert()

static VALUE rb_hash_invert ( VALUE  hash)
static

Definition at line 2345 of file hash.c.

References rb_hash_foreach(), rb_hash_invert_i(), and rb_hash_new().

Referenced by env_invert(), and Init_Hash().

◆ rb_hash_invert_i()

static int rb_hash_invert_i ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 2308 of file hash.c.

References rb_hash_aset(), and ST_CONTINUE.

Referenced by rb_hash_invert().

◆ rb_hash_iter_lev()

int rb_hash_iter_lev ( VALUE  h)

Definition at line 270 of file hash.c.

References RHASH_ITER_LEV.

◆ rb_hash_keep_if()

VALUE rb_hash_keep_if ( VALUE  hash)

◆ rb_hash_key()

static VALUE rb_hash_key ( VALUE  hash,
VALUE  value 
)
static

Definition at line 1086 of file hash.c.

References key_i(), Qnil, and rb_hash_foreach().

Referenced by Init_Hash(), and rb_hash_index().

◆ rb_hash_keys()

VALUE rb_hash_keys ( VALUE  hash)

◆ rb_hash_le()

static VALUE rb_hash_le ( VALUE  hash,
VALUE  other 
)
static

Definition at line 2936 of file hash.c.

References hash_le(), Qfalse, RHASH_SIZE, and to_hash().

Referenced by Init_Hash().

◆ rb_hash_lookup()

VALUE rb_hash_lookup ( VALUE  hash,
VALUE  key 
)

◆ rb_hash_lookup2()

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

◆ rb_hash_lt()

static VALUE rb_hash_lt ( VALUE  hash,
VALUE  other 
)
static

Definition at line 2957 of file hash.c.

References hash_le(), Qfalse, RHASH_SIZE, and to_hash().

Referenced by Init_Hash().

◆ rb_hash_merge()

static VALUE rb_hash_merge ( VALUE  hash1,
VALUE  hash2 
)
static

Definition at line 2515 of file hash.c.

References rb_hash_update(), and rb_obj_dup().

Referenced by Init_Hash().

◆ rb_hash_modify()

static void rb_hash_modify ( VALUE  hash)
static

◆ rb_hash_modify_check()

static void rb_hash_modify_check ( VALUE  hash)
static

◆ rb_hash_new()

VALUE rb_hash_new ( void  )

Definition at line 441 of file hash.c.

References hash_alloc(), and rb_cHash.

Referenced by args_kw_argv_to_hash(), args_setup_kw_parameters(), args_setup_kw_rest_parameter(), args_stored_kw_argv_to_hash(), ary_tmp_hash_new(), check_exec_fds(), check_exec_options_i_extract(), core_hash_from_ary(), count_nodes(), count_objects(), count_objects_size(), count_symbols(), cState_to_h(), date__httpdate(), date__iso8601(), date__jisx0301(), date__parse(), date__rfc2822(), date__rfc3339(), date__xmlschema(), date_s__strptime_internal(), enum_group_by(), enum_to_h(), enum_uniq(), env_select(), env_to_hash(), etc_systmpdir(), fdbm_invert(), fdbm_to_hash(), fgdbm_invert(), fgdbm_to_hash(), fsdbm_invert(), fsdbm_to_hash(), gc_latest_gc_info(), gc_profile_record_get(), gc_stat(), ibf_load_object_hash(), Init_GC(), Init_ossl_asn1(), Init_ossl_x509name(), Init_sizeof(), Init_VM(), Init_vm_objects(), io_s_write(), iseq_build_from_ary_body(), iseq_compile_each(), iseq_data_to_ary(), JSON_parse_object(), lazy_uniq(), local_var_list_init(), make_compile_option_value(), make_rest_kw_hash(), match_named_captures(), mString_to_json_raw_object(), nil_to_h(), ole_const_load(), olerecord_set_ivar(), ossl_dh_get_params(), ossl_dsa_get_params(), ossl_rsa_get_params(), ossl_sslctx_get_session_cache_stats(), process_options(), pruby_init(), r_object0(), rb_ary_to_h(), rb_coverage_peek_result(), rb_coverage_start(), rb_during_gc(), rb_econv_prepare_options(), rb_enc_aliases(), rb_execarg_parent_start1(), rb_Hash(), rb_hash_compact(), rb_hash_invert(), rb_hash_reject(), rb_hash_select(), rb_hash_transform_values(), rb_ident_hash_new(), rb_inflate_s_allocate(), rb_realpath_internal(), rb_reg_named_captures(), rb_struct_to_h(), rb_vm_fstring_table(), recursive_list_access(), recursive_push(), ripper_init_eventids1_table(), ripper_init_eventids2_table(), ruby_thread_init(), separate_symbol(), setup_gc_stat_symbols(), setup_hash(), sig_list(), tr_setup_table(), tr_trans(), tracepoint_stat_s(), vm_caller_setup_arg_kw(), vm_default_params(), and vm_stat().

◆ rb_hash_rassoc()

VALUE rb_hash_rassoc ( VALUE  hash,
VALUE  obj 
)

Definition at line 2631 of file hash.c.

References Qnil, rassoc_i(), and rb_hash_foreach().

Referenced by Init_Hash().

◆ rb_hash_rehash()

VALUE rb_hash_rehash ( VALUE  hash)

◆ rb_hash_rehash_i()

static int rb_hash_rehash_i ( VALUE  key,
VALUE  value,
VALUE  arg 
)
static

Definition at line 764 of file hash.c.

References ST_CONTINUE, and st_insert.

Referenced by rb_hash_rehash().

◆ rb_hash_reject()

VALUE rb_hash_reject ( VALUE  hash)

◆ rb_hash_reject_bang()

VALUE rb_hash_reject_bang ( VALUE  hash)

◆ rb_hash_replace()

static VALUE rb_hash_replace ( VALUE  hash,
VALUE  hash2 
)
static

◆ rb_hash_s_create()

static VALUE rb_hash_s_create ( int  argc,
VALUE argv,
VALUE  klass 
)
static

◆ rb_hash_s_try_convert()

static VALUE rb_hash_s_try_convert ( VALUE  dummy,
VALUE  hash 
)
static

Definition at line 753 of file hash.c.

References rb_check_hash_type().

Referenced by has_extra_methods(), Init_Hash(), and rb_hash_s_create().

◆ rb_hash_search_value()

static int rb_hash_search_value ( VALUE  key,
VALUE  value,
VALUE  arg 
)
static

Definition at line 2116 of file hash.c.

References Qtrue, rb_equal(), ST_CONTINUE, and ST_STOP.

Referenced by rb_hash_has_value().

◆ rb_hash_select()

VALUE rb_hash_select ( VALUE  hash)

◆ rb_hash_select_bang()

VALUE rb_hash_select_bang ( VALUE  hash)

◆ rb_hash_set_default()

static VALUE rb_hash_set_default ( VALUE  hash,
VALUE  ifnone 
)
static

Definition at line 994 of file hash.c.

References rb_hash_modify_check(), and SET_DEFAULT.

Referenced by Init_Hash().

◆ rb_hash_set_default_proc()

VALUE rb_hash_set_default_proc ( VALUE  hash,
VALUE  proc 
)

◆ rb_hash_set_ifnone()

VALUE rb_hash_set_ifnone ( VALUE  hash,
VALUE  ifnone 
)

Definition at line 93 of file hash.c.

References hash(), RB_OBJ_WRITE, and RHASH.

◆ rb_hash_shift()

static VALUE rb_hash_shift ( VALUE  hash)
static

◆ rb_hash_size()

VALUE rb_hash_size ( VALUE  hash)

Definition at line 1678 of file hash.c.

References INT2FIX, and RHASH_SIZE.

Referenced by hash_enum_size(), and Init_Hash().

◆ rb_hash_tbl()

struct st_table* rb_hash_tbl ( VALUE  hash)

Definition at line 483 of file hash.c.

References hash_tbl(), and OBJ_WB_UNPROTECT.

Referenced by collect_values_of_values().

◆ rb_hash_tbl_raw()

struct st_table* rb_hash_tbl_raw ( VALUE  hash)

◆ rb_hash_to_a()

static VALUE rb_hash_to_a ( VALUE  hash)
static

Definition at line 1900 of file hash.c.

References OBJ_INFECT, rb_ary_new_capa(), rb_hash_foreach(), RHASH_SIZE, and to_a_i().

Referenced by Init_Hash(), and rb_hash_flatten().

◆ rb_hash_to_h()

static VALUE rb_hash_to_h ( VALUE  hash)
static

Definition at line 1988 of file hash.c.

References hash(), hash_dup(), HASH_PROC_DEFAULT, rb_cHash, rb_obj_class(), and RBASIC.

Referenced by Init_Hash().

◆ rb_hash_to_hash()

static VALUE rb_hash_to_hash ( VALUE  hash)
static

Definition at line 1974 of file hash.c.

References hash().

Referenced by Init_Hash().

◆ rb_hash_to_proc()

static VALUE rb_hash_to_proc ( VALUE  hash)
static

Definition at line 3014 of file hash.c.

References hash_proc_call(), and rb_func_proc_new().

Referenced by Init_Hash().

◆ rb_hash_transform_values()

static VALUE rb_hash_transform_values ( VALUE  hash)
static

◆ rb_hash_transform_values_bang()

static VALUE rb_hash_transform_values_bang ( VALUE  hash)
static

◆ rb_hash_update()

static VALUE rb_hash_update ( VALUE  hash1,
VALUE  hash2 
)
static

◆ rb_hash_update_block_callback()

static int rb_hash_update_block_callback ( st_data_t key,
st_data_t value,
struct update_arg arg,
int  existing 
)
static

◆ rb_hash_update_block_i()

static int rb_hash_update_block_i ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 2397 of file hash.c.

References rb_hash_update_block_callback(), RHASH_UPDATE, and ST_CONTINUE.

Referenced by rb_hash_update().

◆ rb_hash_update_by()

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

◆ rb_hash_update_callback()

static int rb_hash_update_callback ( st_data_t key,
st_data_t value,
struct update_arg arg,
int  existing 
)
static

◆ rb_hash_update_func_callback()

static int rb_hash_update_func_callback ( st_data_t key,
st_data_t value,
struct update_arg arg,
int  existing 
)
static

◆ rb_hash_update_func_i()

static int rb_hash_update_func_i ( VALUE  key,
VALUE  value,
VALUE  arg0 
)
static

◆ rb_hash_update_i()

static int rb_hash_update_i ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 2371 of file hash.c.

References rb_hash_update_callback(), RHASH_UPDATE, and ST_CONTINUE.

Referenced by rb_hash_update(), and rb_hash_update_by().

◆ rb_hash_values()

VALUE rb_hash_values ( VALUE  hash)

◆ rb_hash_values_at()

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

Definition at line 1358 of file hash.c.

References argc, rb_ary_new2, rb_ary_push(), rb_hash_aref(), and result.

Referenced by Init_Hash().

◆ rb_ident_hash()

static st_index_t rb_ident_hash ( st_data_t  n)
static

Definition at line 283 of file hash.c.

References FLONUM_P, key64_hash(), rb_float_value(), rb_hash_start(), and st_data_t.

◆ rb_ident_hash_new()

VALUE rb_ident_hash_new ( void  )

◆ rb_init_identtable()

st_table* rb_init_identtable ( void  )

Definition at line 2816 of file hash.c.

References st_init_table.

Referenced by obj_alloc_by_klass(), rb_marshal_dump_limited(), rb_marshal_load_with_proc(), and w_object().

◆ rb_init_identtable_with_size()

st_table* rb_init_identtable_with_size ( st_index_t  size)

Definition at line 2822 of file hash.c.

References st_init_table_with_size.

◆ rb_obj_hash()

VALUE rb_obj_hash ( VALUE  obj)

Definition at line 263 of file hash.c.

References any_hash(), objid_hash(), and ST2FIX.

Referenced by InitVM_Object(), and rb_obj_equal().

◆ rb_objid_hash()

long rb_objid_hash ( st_index_t  index)

Definition at line 251 of file hash.c.

References key64_hash(), and rb_hash_start().

Referenced by any_hash(), objid_hash(), rb_dbl_long_hash(), rb_hash(), and rb_obj_equal().

◆ recursive_eql()

static VALUE recursive_eql ( VALUE  hash,
VALUE  dt,
int  recur 
)
static

Definition at line 2175 of file hash.c.

References eql_i(), Qtrue, rb_hash_foreach(), and equal_data::result.

Referenced by hash_equal().

◆ reject_i()

static int reject_i ( VALUE  key,
VALUE  value,
VALUE  result 
)
static

Definition at line 1305 of file hash.c.

References rb_hash_aset(), rb_yield_values(), RTEST, and ST_CONTINUE.

Referenced by rb_hash_reject().

◆ replace_i()

static int replace_i ( VALUE  key,
VALUE  val,
VALUE  hash 
)
static

Definition at line 1596 of file hash.c.

References rb_hash_aset(), and ST_CONTINUE.

Referenced by rb_hash_replace().

◆ reset_hash_type()

static VALUE reset_hash_type ( VALUE  arg)
static

Definition at line 2539 of file hash.c.

References reset_hash_type_arg::hash, reset_hash_type_arg::orighash, Qundef, and RHASH.

Referenced by rb_hash_assoc().

◆ ruby_setenv()

void ruby_setenv ( const char *  name,
const char *  value 
)

◆ ruby_unsetenv()

void ruby_unsetenv ( const char *  name)

Definition at line 3528 of file hash.c.

References ruby_setenv().

◆ select_i()

static int select_i ( VALUE  key,
VALUE  value,
VALUE  result 
)
static

Definition at line 1398 of file hash.c.

References rb_hash_aset(), rb_yield_values(), RTEST, and ST_CONTINUE.

Referenced by rb_hash_select().

◆ set_if_not_nil()

static int set_if_not_nil ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 2706 of file hash.c.

References NIL_P, rb_hash_aset(), and ST_CONTINUE.

Referenced by rb_hash_compact().

◆ set_proc_default()

static void set_proc_default ( VALUE  hash,
VALUE  proc 
)
static

◆ shift_i_safe()

static int shift_i_safe ( VALUE  key,
VALUE  value,
VALUE  arg 
)
static

Definition at line 1195 of file hash.c.

References key, shift_var::key, ST_STOP, and shift_var::val.

Referenced by rb_hash_shift().

◆ st_foreach_safe()

void st_foreach_safe ( st_table table,
int(*)(ANYARGS func,
st_data_t  a 
)

◆ tbl_update()

static int tbl_update ( VALUE  hash,
VALUE  key,
tbl_update_func  func,
st_data_t  optional_arg 
)
static

◆ to_a_i()

static int to_a_i ( VALUE  key,
VALUE  value,
VALUE  ary 
)
static

Definition at line 1882 of file hash.c.

References rb_ary_push(), rb_assoc_new(), and ST_CONTINUE.

Referenced by rb_hash_to_a().

◆ to_hash()

static VALUE to_hash ( VALUE  hash)
static

◆ transform_values_i()

static int transform_values_i ( VALUE  key,
VALUE  value,
VALUE  result 
)
static

Definition at line 1818 of file hash.c.

References rb_hash_aset(), rb_yield(), and ST_CONTINUE.

Referenced by rb_hash_transform_values(), and rb_hash_transform_values_bang().

◆ values_i()

static int values_i ( VALUE  key,
VALUE  value,
VALUE  ary 
)
static

Definition at line 2042 of file hash.c.

References rb_ary_push(), and ST_CONTINUE.

Referenced by id2key(), and rb_hash_values().

Variable Documentation

◆ environ

char** environ

◆ envtbl

VALUE envtbl
static

◆ id_default

ID id_default
static

Definition at line 84 of file hash.c.

Referenced by Init_Hash(), and rb_hash_default_value().

◆ id_flatten_bang

ID id_flatten_bang
static

Definition at line 84 of file hash.c.

Referenced by Init_Hash(), and rb_hash_flatten().

◆ id_hash

ID id_hash
static

Definition at line 84 of file hash.c.

Referenced by hash_recursive(), and Init_Hash().

◆ id_yield

ID id_yield
static

Definition at line 84 of file hash.c.

Referenced by Init_Hash(), rb_hash_default(), and rb_hash_default_value().

◆ identhash

const struct st_hash_type identhash
static
Initial value:
= {
}
#define rb_ident_cmp
Definition: hash.c:280
static st_index_t rb_ident_hash(st_data_t n)
Definition: hash.c:283

Definition at line 299 of file hash.c.

Referenced by rb_hash_compare_by_id().

◆ objhash

const struct st_hash_type objhash
static
Initial value:
= {
}
static int rb_any_cmp(VALUE a, VALUE b)
Definition: hash.c:100
static st_index_t rb_any_hash(VALUE a)
Definition: hash.c:213

Definition at line 275 of file hash.c.

◆ origenviron

char** origenviron
static

Definition at line 3045 of file hash.c.

Referenced by ruby_setenv().

◆ path_tainted

int path_tainted = -1
static

Definition at line 3043 of file hash.c.

Referenced by env_path_tainted(), and rb_env_path_tainted().

◆ prime1

const uint64_t prime1 = ((uint64_t)0x2e0bb864 << 32) | 0xe9ea7df5
static

Definition at line 223 of file hash.c.

◆ prime2

const uint64_t prime2 = ((uint64_t)0xcdb32970 << 32) | 0x830fcaa1
static

Definition at line 224 of file hash.c.

◆ rb_cHash

VALUE rb_cHash