Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
Data Structures | Macros | Typedefs | Functions | Variables
hash.c File Reference
#include "ruby/internal/config.h"
#include <errno.h>
#include "debug_counter.h"
#include "id.h"
#include "internal.h"
#include "internal/array.h"
#include "internal/bignum.h"
#include "internal/class.h"
#include "internal/cont.h"
#include "internal/error.h"
#include "internal/hash.h"
#include "internal/object.h"
#include "internal/proc.h"
#include "internal/symbol.h"
#include "internal/time.h"
#include "internal/vm.h"
#include "probes.h"
#include "ruby/st.h"
#include "ruby/util.h"
#include "ruby_assert.h"
#include "symbol.h"
#include "transient_heap.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  transform_keys_args
 
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))
 

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)
 
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)
 
VALUE rb_hash_new_with_size (st_index_t size)
 
VALUE rb_hash_dup (VALUE hash)
 
VALUE rb_hash_resurrect (VALUE hash)
 
struct st_tablerb_hash_tbl_raw (VALUE hash, const char *file, int line)
 
struct st_tablerb_hash_tbl (VALUE hash, const char *file, int line)
 
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)
 
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_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)
 
VALUE rb_hash_keys (VALUE hash)
 
VALUE rb_hash_values (VALUE hash)
 
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)
 
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
 

Macro Definition Documentation

◆ COPY_DEFAULT

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

Definition at line 66 of file hash.c.

◆ env_name

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

Definition at line 4905 of file hash.c.

◆ ENVMATCH

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

Definition at line 4825 of file hash.c.

◆ ENVNMATCH

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

Definition at line 4826 of file hash.c.

◆ FREE_ENVIRON

#define FREE_ENVIRON (   e)

Definition at line 4819 of file hash.c.

◆ get_env_ptr

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

Definition at line 4893 of file hash.c.

◆ GET_ENVIRON

#define GET_ENVIRON (   e)    (e)

Definition at line 4818 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) || \
#define FL_EXIVAR
Definition: fl_type.h:58
VALUE rb_obj_class(VALUE)
Definition: object.c:245
@ RHASH_PROC_DEFAULT
Definition: hash.h:25
#define RHASH_IFNONE(h)
Definition: rhash.h:49
#define NIL_P

Definition at line 55 of file hash.c.

◆ HASH_ASSERT

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

Definition at line 449 of file hash.c.

◆ HASH_DEBUG

#define HASH_DEBUG   0

Definition at line 48 of file hash.c.

◆ hash_verify

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

Definition at line 526 of file hash.c.

◆ identhash

#define identhash   rb_hashtype_ident

Definition at line 335 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: st.h:22

Definition at line 1633 of file hash.c.

◆ rb_ident_cmp

#define rb_ident_cmp   st_numcmp

Definition at line 316 of file hash.c.

◆ RHASH_AR_CLEARED_HINT

#define RHASH_AR_CLEARED_HINT   0xff

Definition at line 356 of file hash.c.

◆ RHASH_AR_TABLE_BOUND

#define RHASH_AR_TABLE_BOUND (   h)
Value:
(HASH_ASSERT(RHASH_AR_TABLE_P(h)), \
RHASH_AR_TABLE_BOUND_RAW(h))
#define HASH_ASSERT(expr)
Definition: hash.c:449

Definition at line 443 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) & \
@ RHASH_AR_TABLE_BOUND_SHIFT
Definition: hash.h:30
@ RHASH_AR_TABLE_BOUND_MASK
Definition: hash.h:29
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#define RBASIC(obj)
Definition: rbasic.h:34

Definition at line 439 of file hash.c.

◆ RHASH_AR_TABLE_MAX_BOUND

#define RHASH_AR_TABLE_MAX_BOUND   RHASH_AR_TABLE_MAX_SIZE

Definition at line 353 of file hash.c.

◆ RHASH_AR_TABLE_REF

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

Definition at line 355 of file hash.c.

◆ RHASH_AR_TABLE_SIZE

#define RHASH_AR_TABLE_SIZE (   h)
Value:
(HASH_ASSERT(RHASH_AR_TABLE_P(h)), \
RHASH_AR_TABLE_SIZE_RAW(h))

Definition at line 436 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 623 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 590 of file hash.c.

◆ RHASH_ST_TABLE_SET

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

Definition at line 446 of file hash.c.

◆ RHASH_TYPE

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

Definition at line 447 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 591 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 1702 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:1696

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

◆ SET_PROC_DEFAULT

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

Definition at line 64 of file hash.c.

◆ st_index_hash

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

Definition at line 279 of file hash.c.

◆ to_hash

#define to_hash   rb_to_hash_type

Definition at line 1857 of file hash.c.

◆ UPDATE_CALLBACK

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

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

◆ st_foreach_func

typedef int st_foreach_func(st_data_t, st_data_t, st_data_t)

Definition at line 1286 of file hash.c.

◆ st_hash_t

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

Function Documentation

◆ Init_Hash()

void Init_Hash ( void  )

◆ rb_check_hash_type()

VALUE rb_check_hash_type ( VALUE  hash)

Definition at line 1860 of file hash.c.

References update_arg::hash, rb_check_convert_type_with_id(), and T_HASH.

Referenced by rb_econv_prepare_options(), and rb_Hash().

◆ rb_dbl_long_hash()

long rb_dbl_long_hash ( double  d)

Definition at line 180 of file hash.c.

References rb_memhash().

◆ rb_env_clear()

VALUE rb_env_clear ( void  )

Definition at line 5839 of file hash.c.

References key, RARRAY_AREF, RARRAY_LEN, RB_GC_GUARD, RSTRING_PTR, ruby_setenv(), and TRUE.

Referenced by rb_execarg_run_options().

◆ rb_env_path_tainted()

int rb_env_path_tainted ( void  )

Definition at line 5051 of file hash.c.

References rb_warn_deprecated_to_remove().

◆ 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 4734 of file hash.c.

References st_hash_type::hash, key, RHASH_TBL_RAW, and st_update.

◆ rb_hash_ar_table()

ar_table * rb_hash_ar_table ( VALUE  hash)

Definition at line 560 of file hash.c.

References HASH_ASSERT, and RHASH.

◆ rb_hash_ar_table_p()

int rb_hash_ar_table_p ( VALUE  hash)

Definition at line 548 of file hash.c.

References FALSE, FL_TEST_RAW, HASH_ASSERT, NULL, RHASH, RHASH_ST_TABLE_FLAG, and TRUE.

◆ rb_hash_ar_table_size()

size_t rb_hash_ar_table_size ( void  )

Definition at line 369 of file hash.c.

◆ rb_hash_aref()

VALUE rb_hash_aref ( VALUE  hash,
VALUE  key 
)

◆ rb_hash_aset()

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

◆ rb_hash_assoc()

VALUE rb_hash_assoc ( VALUE  hash,
VALUE  key 
)

◆ rb_hash_bulk_insert()

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

◆ rb_hash_clear()

VALUE rb_hash_clear ( VALUE  hash)

Definition at line 2819 of file hash.c.

References rb_hash_foreach(), RHASH_ITER_LEV, and st_clear.

Referenced by Init_Hash(), and yyparse().

◆ rb_hash_compare_by_id_p()

VALUE rb_hash_compare_by_id_p ( VALUE  hash)

Definition at line 4432 of file hash.c.

References st_hash_type::hash, identhash, Qfalse, and Qtrue.

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 2327 of file hash.c.

References key, Qnil, Qundef, and rb_hash_delete_entry().

◆ rb_hash_delete_entry()

VALUE rb_hash_delete_entry ( VALUE  hash,
VALUE  key 
)

Definition at line 2309 of file hash.c.

References key, Qundef, and rb_hash_stlike_delete().

Referenced by rb_gc_free_dsymbol(), rb_hash_delete(), and rb_sym2id().

◆ rb_hash_delete_if()

VALUE rb_hash_delete_if ( VALUE  hash)

Definition at line 2490 of file hash.c.

References rb_hash_foreach(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Hash().

◆ rb_hash_dup()

VALUE rb_hash_dup ( VALUE  hash)

◆ rb_hash_fetch()

VALUE rb_hash_fetch ( VALUE  hash,
VALUE  key 
)

Definition at line 2138 of file hash.c.

References key.

Referenced by rb_category_compile_warn(), rb_category_warn(), and rb_category_warning().

◆ rb_hash_foreach()

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

◆ rb_hash_freeze()

VALUE rb_hash_freeze ( VALUE  hash)

Definition at line 101 of file hash.c.

References rb_obj_freeze().

Referenced by rb_econv_prepare_options().

◆ rb_hash_has_key()

VALUE rb_hash_has_key ( VALUE  hash,
VALUE  key 
)

Definition at line 3638 of file hash.c.

References key, NULL, Qfalse, and Qtrue.

Referenced by Init_Hash().

◆ rb_hash_key_str()

VALUE rb_hash_key_str ( VALUE  key)

Definition at line 2852 of file hash.c.

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

◆ rb_hash_keys()

VALUE rb_hash_keys ( VALUE  hash)

◆ rb_hash_lookup()

VALUE rb_hash_lookup ( VALUE  hash,
VALUE  key 
)

Definition at line 2072 of file hash.c.

References key, Qnil, and rb_hash_lookup2().

◆ rb_hash_lookup2()

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

Definition at line 2059 of file hash.c.

References def(), and key.

Referenced by rb_hash_lookup(), rb_io_extract_encoding_option(), and rb_str_format().

◆ rb_hash_new()

VALUE rb_hash_new ( void  )

◆ rb_hash_new_with_size()

VALUE rb_hash_new_with_size ( st_index_t  size)

◆ rb_hash_rassoc()

VALUE rb_hash_rassoc ( VALUE  hash,
VALUE  obj 
)

Definition at line 4221 of file hash.c.

References st_hash_type::hash, Qnil, and rb_hash_foreach().

Referenced by Init_Hash().

◆ rb_hash_rehash()

VALUE rb_hash_rehash ( VALUE  hash)

◆ rb_hash_reject()

VALUE rb_hash_reject ( VALUE  hash)

◆ rb_hash_reject_bang()

VALUE rb_hash_reject_bang ( VALUE  hash)

Definition at line 2519 of file hash.c.

References Qnil, rb_hash_foreach(), RETURN_SIZED_ENUMERATOR, and RHASH_SIZE.

Referenced by Init_Hash().

◆ rb_hash_resurrect()

VALUE rb_hash_resurrect ( VALUE  hash)

Definition at line 1590 of file hash.c.

References hash_foreach_arg::hash, and rb_cHash.

◆ 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 113 of file hash.c.

References RB_OBJ_WRITE, and RHASH.

◆ rb_hash_set_pair()

VALUE rb_hash_set_pair ( VALUE  hash,
VALUE  arg 
)

◆ rb_hash_size()

VALUE rb_hash_size ( VALUE  hash)

Definition at line 2981 of file hash.c.

References INT2FIX, and RHASH_SIZE.

Referenced by Init_Hash().

◆ rb_hash_size_num()

size_t rb_hash_size_num ( VALUE  hash)

Definition at line 2987 of file hash.c.

References RHASH_SIZE.

◆ rb_hash_st_table()

st_table * rb_hash_st_table ( VALUE  hash)

Definition at line 567 of file hash.c.

References HASH_ASSERT, and RHASH.

◆ rb_hash_st_table_set()

void rb_hash_st_table_set ( VALUE  hash,
st_table st 
)

Definition at line 574 of file hash.c.

References FL_SET_RAW, HASH_ASSERT, NULL, RHASH, and RHASH_ST_TABLE_FLAG.

◆ rb_hash_stlike_delete()

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

Definition at line 2293 of file hash.c.

References st_delete.

Referenced by rb_hash_delete_entry().

◆ rb_hash_stlike_foreach()

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

◆ 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 
)

◆ rb_hash_stlike_lookup()

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

Definition at line 2026 of file hash.c.

References key.

Referenced by mjit_valid_class_serial_p().

◆ 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 1659 of file hash.c.

References key, and st_update.

◆ rb_hash_tbl()

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

Definition at line 1609 of file hash.c.

References OBJ_WB_UNPROTECT, and rb_hash_tbl_raw().

◆ rb_hash_tbl_raw()

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

Definition at line 1603 of file hash.c.

Referenced by rb_hash_tbl().

◆ rb_hash_update_by()

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

Definition at line 4036 of file hash.c.

References update_func_arg::func, update_func_arg::hash, rb_hash_foreach(), and to_hash.

◆ 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 2652 of file hash.c.

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

Referenced by Init_Hash().

◆ rb_init_identtable()

st_table * rb_init_identtable ( void  )

Definition at line 4451 of file hash.c.

References identhash, and st_init_table.

Referenced by Init_MemoryView().

◆ rb_ivar_set_internal()

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

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

References update_arg::hash, rb_convert_type_with_id(), and T_HASH.

◆ ruby_setenv()

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

◆ ruby_unsetenv()

void ruby_unsetenv ( const char *  name)

Definition at line 5284 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 
)

Variable Documentation

◆ environ

char** environ
extern

Referenced by Init_Hash(), and ruby_setenv().

◆ rb_cHash

VALUE rb_cHash

Definition at line 106 of file hash.c.

Referenced by Init_Hash(), rb_extract_keywords(), rb_hash_new(), and rb_hash_resurrect().

◆ rb_hashtype_ident

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

Definition at line 336 of file hash.c.