Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

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_table * | rb_hash_ar_table (VALUE hash)
st_table * | rb_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_table * | rb_hash_tbl_raw (VALUE hash)
struct st_table * | rb_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_table * | rb_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 4687 of file hash.c.

## ◆ ENVMATCH

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

Definition at line 4578 of file hash.c.

## ◆ ENVNMATCH

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

Definition at line 4579 of file hash.c.

## ◆ FREE_ENVIRON

#define FREE_ENVIRON | ( |  | e | ) |

Definition at line 4572 of file hash.c.

## ◆ get_env_ptr

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

Definition at line 4674 of file hash.c.

## ◆ GET_ENVIRON

#define GET_ENVIRON | ( |  | e | ) | (e)

Definition at line 4571 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) || \
!NIL_P(RHASH_IFNONE(hash)))

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); \
}

Definition at line 1598 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:
(HASH_ASSERT(RHASH_AR_TABLE_P(h)), \
RHASH_AR_TABLE_BOUND_RAW(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) & \
(RHASH_AR_TABLE_BOUND_MASK >> RHASH_AR_TABLE_BOUND_SHIFT)))

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:
(HASH_ASSERT(RHASH_AR_TABLE_P(h)), \
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,
|  |  | s
| ) |  | 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 1667 of file hash.c.

## ◆ RHASH_UPDATE_ITER

#define RHASH_UPDATE_ITER | ( |  | h,
|  |  | iter_lev,
|  |  | key,
|  |  | func,
|  |  | a
| ) |  |

Value:
do { \
tbl_update((h), (key), UPDATE_CALLBACK((iter_lev), func), (st_data_t)(a)); \
} while (0)

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

## ◆ UPDATE_CALLBACK

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

Definition at line 1661 of file hash.c.

## Typedef Documentation

## ◆ ar_table

typedef struct ar_table_struct ar_table

## ◆ ar_table_pair

typedef struct ar_table_pair_struct ar_table_pair

## ◆ rb_foreach_func

typedef int rb_foreach_func(VALUE, VALUE, VALUE)

Definition at line 1284 of file hash.c.

## ◆ st_foreach_func

typedef int st_foreach_func(st_data_t, st_data_t, st_data_t)

Definition at line 1249 of file hash.c.

## ◆ st_hash_t

typedef st_index_t 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 1621 of file hash.c.

## Function Documentation

## ◆ Init_Hash()

void Init_Hash | ( | void |  | ) |

Definition at line 6222 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 1825 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 5553 of file hash.c.

References i, and keys.

## ◆ rb_env_path_tainted()

int rb_env_path_tainted | ( | void |  | ) |

Definition at line 4829 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 4472 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 1964 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 2779 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 3942 of file hash.c.

## ◆ rb_hash_bulk_insert()

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

Definition at line 4515 of file hash.c.

## ◆ rb_hash_clear()

VALUE rb_hash_clear | ( | VALUE | hash | ) |

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

## ◆ rb_hash_default_value()

VALUE rb_hash_default_value | ( | VALUE | hash,
|  | VALUE | key
| ) |  |

Definition at line 1917 of file hash.c.

## ◆ rb_hash_delete()

VALUE rb_hash_delete | ( | VALUE | hash,
|  | VALUE | key
| ) |  |

Definition at line 2271 of file hash.c.

## ◆ rb_hash_delete_entry()

VALUE rb_hash_delete_entry | ( | VALUE | hash,
|  | VALUE | key
| ) |  |

Definition at line 2253 of file hash.c.

## ◆ rb_hash_delete_if()

VALUE rb_hash_delete_if | ( | VALUE | hash | ) |

Definition at line 2420 of file hash.c.

## ◆ rb_hash_dup()

VALUE rb_hash_dup | ( | VALUE | hash | ) |

Definition at line 1537 of file hash.c.

## ◆ rb_hash_fetch()

VALUE rb_hash_fetch | ( | VALUE | hash,
|  | VALUE | key
| ) |  |

Definition at line 2061 of file hash.c.

## ◆ rb_hash_fetch_values()

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

Definition at line 2567 of file hash.c.

## ◆ rb_hash_foreach()

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

Definition at line 1461 of file hash.c.

Referenced by rb_clear_coverages().

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

## ◆ rb_hash_keep_if()

VALUE rb_hash_keep_if | ( | VALUE | hash | ) |

Definition at line 2668 of file hash.c.

## ◆ rb_hash_key_str()

VALUE rb_hash_key_str | ( | VALUE | key | ) |

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

## ◆ rb_hash_lookup()

VALUE rb_hash_lookup | ( | VALUE | hash,
|  | VALUE | key
| ) |  |

Definition at line 1990 of file hash.c.

## ◆ rb_hash_lookup2()

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

Definition at line 1977 of file hash.c.

Referenced by rb_io_extract_encoding_option().

## ◆ rb_hash_new()

VALUE rb_hash_new | ( | void |  | ) |

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

## ◆ rb_hash_rehash()

VALUE rb_hash_rehash | ( | VALUE | hash | ) |

Definition at line 1885 of file hash.c.

## ◆ rb_hash_reject()

VALUE rb_hash_reject | ( | VALUE | hash | ) |

Definition at line 2477 of file hash.c.

## ◆ rb_hash_reject_bang()

VALUE rb_hash_reject_bang | ( | VALUE | hash | ) |

Definition at line 2440 of file hash.c.

## ◆ rb_hash_resurrect()

MJIT_FUNC_EXPORTED VALUE rb_hash_resurrect | ( | VALUE | hash | ) |

Definition at line 1548 of file hash.c.

## ◆ rb_hash_select()

VALUE rb_hash_select | ( | VALUE | hash | ) |

Definition at line 2606 of file hash.c.

## ◆ rb_hash_select_bang()

VALUE rb_hash_select_bang | ( | VALUE | hash | ) |

Definition at line 2641 of file hash.c.

## ◆ rb_hash_set_default_proc()

VALUE rb_hash_set_default_proc | ( | VALUE | hash,
|  | VALUE | proc
| ) |  |

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

## ◆ rb_hash_size()

VALUE rb_hash_size | ( | VALUE | hash | ) |

Definition at line 2866 of file hash.c.

## ◆ rb_hash_size_num()

size_t rb_hash_size_num | ( | VALUE | hash | ) |

Definition at line 2872 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 2237 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 1420 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 1431 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 1944 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 1624 of file hash.c.

## ◆ rb_hash_tbl()

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

Definition at line 1574 of file hash.c.

## ◆ rb_hash_tbl_raw()

MJIT_FUNC_EXPORTED struct st_table* rb_hash_tbl_raw | ( | VALUE | hash | ) |

Definition at line 1567 of file hash.c.

## ◆ rb_hash_transient_heap_evacuate()

void rb_hash_transient_heap_evacuate | ( | VALUE | hash,
|  | int | promote
| ) |  |

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

## ◆ rb_hash_values()

VALUE rb_hash_values | ( | VALUE | hash | ) |

Definition at line 3381 of file hash.c.

## ◆ rb_hash_values_at()

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

Definition at line 2539 of file hash.c.

## ◆ rb_ident_hash_new()

VALUE rb_ident_hash_new | ( | void |  | ) |

Definition at line 4203 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 4211 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 1818 of file hash.c.

## ◆ ruby_setenv()

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

Definition at line 4923 of file hash.c.

References ALLOCV_END, ALLOCV_N, buf, environ, fail, free, GET_ENVIRON, i, L, len, malloc(), name, NULL, PRIuSIZE, putenv(), rb_sprintf(), rb_sys_fail_str(), setenv(), snprintf(), str, strlen(), strncmp(), and unsetenv().

Referenced by ruby_unsetenv().

## ◆ ruby_unsetenv()

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

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

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

Referenced by rb_const_list().

## Variable Documentation

## ◆ environ

char** environ

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_cmp,
rb_ident_hash,
}

Definition at line 322 of file hash.c.

## ◆ ruby_tz_uptodate_p

bool ruby_tz_uptodate_p

Definition at line 674 of file time.c.

RHASH_PROC_DEFAULT
@ RHASH_PROC_DEFAULT
Definition: internal.h:819
HASH_ASSERT
#define HASH_ASSERT(expr)
Definition: hash.c:435
int
__inline__ int
Definition: rb_mjit_min_header-2.7.0.h:2839
rb_ident_cmp
#define rb_ident_cmp
Definition: hash.c:302
rb_obj_class
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
Definition: object.c:217
FL_EXIVAR
#define FL_EXIVAR
Definition: ruby.h:1286
RHASH_IFNONE
#define RHASH_IFNONE(h)
Definition: ruby.h:1129
UPDATE_CALLBACK
#define UPDATE_CALLBACK(iter_lev, func)
Definition: hash.c:1661
RHASH_AR_TABLE_BOUND_MASK
#define RHASH_AR_TABLE_BOUND_MASK
Definition: internal.h:866
key
key
Definition: openssl_missing.h:181
RHASH_AR_TABLE_BOUND_SHIFT
#define RHASH_AR_TABLE_BOUND_SHIFT
Definition: internal.h:867
arg
VALUE arg
Definition: rb_mjit_min_header-2.7.0.h:5601
klass
VALUE klass
Definition: rb_mjit_min_header-2.7.0.h:13254
st_data_t
unsigned long st_data_t
Definition: rb_mjit_min_header-2.7.0.h:5363
NIL_P
#define NIL_P(v)
Definition: ruby.h:482
RBASIC
#define RBASIC(obj)
Definition: ruby.h:1267
update_arg
Definition: hash.c:1612
h
size_t st_index_t h
Definition: rb_mjit_min_header-2.7.0.h:5462
RHASH_AR_TABLE_P
#define RHASH_AR_TABLE_P(hash)
Definition: internal.h:854