Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Internal header for Hash. More...
#include "ruby/internal/config.h"
#include <stddef.h>
#include "ruby/internal/stdbool.h"
#include "ruby/ruby.h"
#include "ruby/st.h"
Go to the source code of this file.
Data Structures | |
struct | RHash |
Macros | |
#define | RHASH_AR_TABLE_MAX_SIZE SIZEOF_VALUE |
#define | RHASH_LEV_MASK |
#define | RHASH(obj) ((struct RHash *)(obj)) |
#define | RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__) |
Typedefs | |
typedef unsigned char | ar_hint_t |
Enumerations | |
enum | ruby_rhash_flags { RHASH_PASS_AS_KEYWORDS = FL_USER1 , RHASH_PROC_DEFAULT = FL_USER2 , RHASH_ST_TABLE_FLAG = FL_USER3 , RHASH_AR_TABLE_SIZE_MASK = (FL_USER4|FL_USER5|FL_USER6|FL_USER7) , RHASH_AR_TABLE_SIZE_SHIFT = (FL_USHIFT+4) , RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11) , RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8) , RHASH_LEV_SHIFT = (FL_USHIFT + 13) , RHASH_LEV_MAX = 127 } |
Internal header for Hash.
Definition in file hash.h.
#define RHASH_AR_TABLE_MAX_SIZE SIZEOF_VALUE |
#define RHASH_LEV_MASK |
#define RHASH_TBL_RAW | ( | h | ) | rb_hash_tbl_raw(h, __FILE__, __LINE__) |
enum ruby_rhash_flags |
long rb_dbl_long_hash | ( | double | d | ) |
Definition at line 180 of file hash.c.
References rb_memhash().
Definition at line 4734 of file hash.c.
References st_hash_type::hash, key, RHASH_TBL_RAW, and st_update.
Definition at line 4432 of file hash.c.
References st_hash_type::hash, identhash, Qfalse, and Qtrue.
Referenced by Init_Hash().
Definition at line 1999 of file hash.c.
References CLASS_OF, FL_TEST, key, LIKELY, Qnil, Qundef, rb_funcall(), rb_method_basic_definition_p, RHASH_IFNONE, and RHASH_PROC_DEFAULT.
Referenced by rb_hash_aref(), and rb_str_format().
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().
Definition at line 2852 of file hash.c.
References FL_EXIVAR, key, rb_cString, rb_fstring(), rb_str_new_frozen(), and RBASIC_CLASS.
Definition at line 3549 of file hash.c.
References ptr, RARRAY_PTR_USE_TRANSIENT, rb_ary_new_capa(), rb_ary_set_len(), rb_gc_writebarrier_remember(), rb_hash_foreach(), RHASH_SIZE, ST_DATA_COMPATIBLE_P, and st_keys.
Referenced by Init_Hash().
VALUE rb_hash_new_with_size | ( | st_index_t | size | ) |
Definition at line 1544 of file hash.c.
References rb_hash_new(), RHASH_AR_TABLE_MAX_SIZE, RHASH_ST_TABLE_SET, and st_init_table_with_size.
Referenced by InitVM_Enumerator().
Definition at line 1960 of file hash.c.
References hash_verify, st_table::num_entries, rb_eRuntimeError, rb_hash_foreach(), rb_raise(), RHASH_ITER_LEV, RHASH_ST_TABLE_SET, st_free_table, st_init_table_with_size, and st_table::type.
Referenced by Init_Hash().
Definition at line 1590 of file hash.c.
References hash_foreach_arg::hash, and rb_cHash.
Definition at line 2234 of file hash.c.
References NIL_P, rb_check_convert_type_with_id(), rb_eTypeError, rb_obj_classname(), rb_obj_is_proc(), rb_raise(), SET_DEFAULT, SET_PROC_DEFAULT, and T_DATA.
Referenced by Init_Hash().
Definition at line 3468 of file hash.c.
References NIL_P, RARRAY_AREF, RARRAY_LEN, rb_builtin_class_name(), rb_check_array_type(), rb_eArgError, rb_eTypeError, rb_hash_aset(), and rb_raise().
Definition at line 567 of file hash.c.
References HASH_ASSERT, and RHASH.
Definition at line 574 of file hash.c.
References FL_SET_RAW, HASH_ASSERT, NULL, RHASH, and RHASH_ST_TABLE_FLAG.
int rb_hash_stlike_foreach | ( | VALUE | hash, |
st_foreach_callback_func * | func, | ||
st_data_t | arg | ||
) |
Definition at line 1457 of file hash.c.
References hash_foreach_arg::arg, hash_foreach_arg::func, hash_foreach_arg::hash, and st_foreach.
Referenced by rb_execarg_extract_options().
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 1468 of file hash.c.
References hash_foreach_arg::arg, hash_foreach_arg::func, hash_foreach_arg::hash, and st_foreach_with_replace.
int rb_hash_stlike_update | ( | VALUE | hash, |
st_data_t | key, | ||
st_update_callback_func * | func, | ||
st_data_t | arg | ||
) |
Definition at line 1603 of file hash.c.
Referenced by rb_hash_tbl().
Definition at line 3593 of file hash.c.
References ptr, RARRAY_PTR_USE_TRANSIENT, rb_ary_new_capa(), rb_ary_set_len(), rb_gc_writebarrier_remember(), rb_hash_foreach(), RHASH_SIZE, ST_DATA_COMPATIBLE_P, and st_values.
Referenced by Init_Hash().
st_table * rb_init_identtable | ( | void | ) |
Definition at line 4451 of file hash.c.
References identhash, and st_init_table.
Referenced by Init_MemoryView().
Definition at line 1853 of file hash.c.
References update_arg::hash, rb_convert_type_with_id(), and T_HASH.