#include "ruby/ruby.h"#include <stdio.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | st_table_entry |
| struct | st_packed_entry |
Defines | |
| #define | STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[(expr) ? 1 : -1]; |
| #define | ST_DEFAULT_MAX_DENSITY 5 |
| #define | ST_DEFAULT_INIT_TABLE_SIZE 11 |
| #define | ST_DEFAULT_SECOND_TABLE_SIZE 19 |
| #define | ST_DEFAULT_PACKED_TABLE_SIZE 18 |
| #define | PACKED_UNIT (int)(sizeof(st_packed_entry) / sizeof(st_table_entry*)) |
| #define | MAX_PACKED_HASH (int)(ST_DEFAULT_PACKED_TABLE_SIZE * sizeof(st_table_entry*) / sizeof(st_packed_entry)) |
| #define | type_numhash st_hashtype_num |
| #define | malloc xmalloc |
| #define | calloc xcalloc |
| #define | realloc xrealloc |
| #define | free(x) xfree(x) |
| #define | numberof(array) (int)(sizeof(array) / sizeof((array)[0])) |
| #define | EQUAL(table, x, y) ((x)==(y) || (*(table)->type->compare)((x),(y)) == 0) |
| #define | do_hash(key, table) (st_index_t)(*(table)->type->hash)((key)) |
| #define | do_hash_bin(key, table) (do_hash((key), (table))%(table)->num_bins) |
| #define | st_alloc_entry() (st_table_entry *)malloc(sizeof(st_table_entry)) |
| #define | st_free_entry(entry) free(entry) |
| #define | st_alloc_table() (st_table *)malloc(sizeof(st_table)) |
| #define | st_dealloc_table(table) free(table) |
| #define | st_alloc_bins(size) (st_table_entry **)calloc(size, sizeof(st_table_entry *)) |
| #define | st_free_bins(bins, size) free(bins) |
| #define | bins as.big.bins |
| #define | head as.big.head |
| #define | tail as.big.tail |
| #define | real_entries as.packed.real_entries |
| #define | PACKED_BINS(table) ((table)->as.packed.entries) |
| #define | PACKED_ENT(table, i) PACKED_BINS(table)[i] |
| #define | PKEY(table, i) PACKED_ENT((table), (i)).key |
| #define | PVAL(table, i) PACKED_ENT((table), (i)).val |
| #define | PHASH(table, i) PACKED_ENT((table), (i)).hash |
| #define | PKEY_SET(table, i, v) (PKEY((table), (i)) = (v)) |
| #define | PVAL_SET(table, i, v) (PVAL((table), (i)) = (v)) |
| #define | PHASH_SET(table, i, v) (PHASH((table), (i)) = (v)) |
| #define | MINSIZE 8 |
| #define | PTR_NOT_EQUAL(table, ptr, hash_val, key) ((ptr) != 0 && ((ptr)->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key))) |
| #define | COLLISION |
| #define | FOUND_ENTRY |
| #define | FIND_ENTRY(table, ptr, hash_val, bin_pos) ((ptr) = find_entry((table), key, (hash_val), ((bin_pos) = (hash_val)%(table)->num_bins))) |
| #define | collision_check 0 |
| #define | collision_check 1 |
| #define | FNV1_32A_INIT 0x811c9dc5 |
| #define | FNV_32_PRIME 0x01000193 |
| #define | MURMUR 2 |
| #define | MurmurMagic_1 (st_index_t)0xc6a4a793 |
| #define | MurmurMagic_2 (st_index_t)0x5bd1e995 |
| #define | MurmurMagic MurmurMagic_2 |
| #define | murmur_step(h, k) murmur((h), (k), 16) |
| #define | murmur1(h) murmur_step((h), 24) |
| #define | data_at(n) (st_index_t)((unsigned char)data[(n)]) |
| #define | UNALIGNED_ADD_4 UNALIGNED_ADD(2); UNALIGNED_ADD(1); UNALIGNED_ADD(0) |
| #define | UNALIGNED_ADD_ALL UNALIGNED_ADD_4 |
| #define | UNALIGNED_ADD(n) |
| #define | UNALIGNED_ADD(n) |
| #define | UNALIGNED_ADD(n) |
Typedefs | |
| typedef struct st_table_entry | st_table_entry |
Functions | |
| STATIC_ASSERT (st_packed_entry, sizeof(st_packed_entry)==sizeof(st_table_entry *[PACKED_UNIT])) | |
| static st_index_t | strhash (st_data_t) |
| static st_index_t | strcasehash (st_data_t) |
| static void | rehash (st_table *) |
| static st_table_entry ** | st_realloc_bins (st_table_entry **bins, st_index_t newsize, st_index_t oldsize) |
| static void | remove_packed_entry (st_table *table, st_index_t i) |
| static void | remove_safe_packed_entry (st_table *table, st_index_t i, st_data_t never) |
| static st_index_t | new_size (st_index_t size) |
| st_table * | st_init_table_with_size (const struct st_hash_type *type, st_index_t size) |
| st_table * | st_init_table (const struct st_hash_type *type) |
| st_table * | st_init_numtable (void) |
| st_table * | st_init_numtable_with_size (st_index_t size) |
| st_table * | st_init_strtable (void) |
| st_table * | st_init_strtable_with_size (st_index_t size) |
| st_table * | st_init_strcasetable (void) |
| st_table * | st_init_strcasetable_with_size (st_index_t size) |
| void | st_clear (st_table *table) |
| void | st_free_table (st_table *table) |
| size_t | st_memsize (const st_table *table) |
| static st_table_entry * | find_entry (st_table *table, st_data_t key, st_index_t hash_val, st_index_t bin_pos) |
| static st_index_t | find_packed_index_from (st_table *table, st_index_t hash_val, st_data_t key, st_index_t i) |
| static st_index_t | find_packed_index (st_table *table, st_index_t hash_val, st_data_t key) |
| int | st_lookup (st_table *table, register st_data_t key, st_data_t *value) |
| int | st_get_key (st_table *table, register st_data_t key, st_data_t *result) |
| static st_table_entry * | new_entry (st_table *table, st_data_t key, st_data_t value, st_index_t hash_val, register st_index_t bin_pos) |
| static void | add_direct (st_table *table, st_data_t key, st_data_t value, st_index_t hash_val, register st_index_t bin_pos) |
| static void | unpack_entries (register st_table *table) |
| static void | add_packed_direct (st_table *table, st_data_t key, st_data_t value, st_index_t hash_val) |
| int | st_insert (register st_table *table, register st_data_t key, st_data_t value) |
| int | st_insert2 (register st_table *table, register st_data_t key, st_data_t value, st_data_t(*func)(st_data_t)) |
| void | st_add_direct (st_table *table, st_data_t key, st_data_t value) |
| static void | rehash (register st_table *table) |
| st_table * | st_copy (st_table *old_table) |
| static void | remove_entry (st_table *table, st_table_entry *ptr) |
| int | st_delete (register st_table *table, register st_data_t *key, st_data_t *value) |
| int | st_delete_safe (register st_table *table, register st_data_t *key, st_data_t *value, st_data_t never) |
| void | st_cleanup_safe (st_table *table, st_data_t never) |
| int | st_update (st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg) |
| int | st_foreach_check (st_table *table, int(*func)(ANYARGS), st_data_t arg, st_data_t never) |
| int | st_foreach (st_table *table, int(*func)(ANYARGS), st_data_t arg) |
| static st_index_t | murmur (st_index_t h, st_index_t k, int r) |
| static st_index_t | murmur_finish (st_index_t h) |
| st_index_t | st_hash (const void *ptr, size_t len, st_index_t h) |
| st_index_t | st_hash_uint32 (st_index_t h, uint32_t i) |
| st_index_t | st_hash_uint (st_index_t h, st_index_t i) |
| st_index_t | st_hash_end (st_index_t h) |
| st_index_t | st_hash_start (st_index_t h) |
| int | st_strcasecmp (const char *s1, const char *s2) |
| int | st_strncasecmp (const char *s1, const char *s2, size_t n) |
| int | st_numcmp (st_data_t x, st_data_t y) |
| st_index_t | st_numhash (st_data_t n) |
Variables | |
| static struct st_hash_type | type_strhash |
| static struct st_hash_type | type_strcasehash |
| static const unsigned int | primes [] |
| #define COLLISION |
Definition at line 373 of file st.c.
Referenced by find_entry().
| #define data_at | ( | n | ) | (st_index_t)((unsigned char)data[(n)]) |
Definition at line 87 of file st.c.
Referenced by st_add_direct(), st_delete(), st_delete_safe(), st_get_key(), st_insert(), st_insert2(), st_lookup(), and st_update().
| #define EQUAL | ( | table, | |||
| x, | |||||
| y | ) | ((x)==(y) || (*(table)->type->compare)((x),(y)) == 0) |
Definition at line 85 of file st.c.
Referenced by find_packed_index_from(), st_delete(), and st_delete_safe().
| #define FIND_ENTRY | ( | table, | |||
| ptr, | |||||
| hash_val, | |||||
| bin_pos | ) | ((ptr) = find_entry((table), key, (hash_val), ((bin_pos) = (hash_val)%(table)->num_bins))) |
Definition at line 377 of file st.c.
Referenced by st_foreach(), st_foreach_check(), st_insert(), st_insert2(), and st_update().
| #define FNV1_32A_INIT 0x811c9dc5 |
Definition at line 1221 of file st.c.
Referenced by strcasehash(), and strhash().
| #define FNV_32_PRIME 0x01000193 |
Definition at line 1226 of file st.c.
Referenced by strcasehash().
| #define FOUND_ENTRY |
Definition at line 374 of file st.c.
Referenced by find_entry().
| #define head as.big.head |
Definition at line 107 of file st.c.
Referenced by ary_ensure_room_for_unshift(), fixup_nodes(), gzfile_read_header(), ip_ruby_cmd_receiver_const_get(), iseq_compile_each(), native_cond_broadcast(), native_cond_signal(), native_cond_timedwait_ms(), new_evstr_gen(), start_document(), and yyparse().
| #define MAX_PACKED_HASH (int)(ST_DEFAULT_PACKED_TABLE_SIZE * sizeof(st_table_entry*) / sizeof(st_packed_entry)) |
| #define MINSIZE 8 |
Definition at line 146 of file st.c.
Referenced by new_size().
| #define murmur1 | ( | h | ) | murmur_step((h), 24) |
Definition at line 1315 of file st.c.
Referenced by st_hash_uint().
| #define murmur_step | ( | h, | |||
| k | ) | murmur((h), (k), 16) |
Definition at line 1310 of file st.c.
Referenced by st_hash(), st_hash_end(), and st_hash_uint32().
| #define MurmurMagic MurmurMagic_2 |
Definition at line 1273 of file st.c.
Referenced by murmur(), murmur_finish(), and st_hash().
| #define numberof | ( | array | ) | (int)(sizeof(array) / sizeof((array)[0])) |
| #define PACKED_BINS | ( | table | ) | ((table)->as.packed.entries) |
Definition at line 112 of file st.c.
Referenced by unpack_entries().
| #define PACKED_ENT | ( | table, | |||
| i | ) | PACKED_BINS(table)[i] |
Definition at line 113 of file st.c.
Referenced by remove_packed_entry(), and st_cleanup_safe().
| #define PACKED_UNIT (int)(sizeof(st_packed_entry) / sizeof(st_table_entry*)) |
| #define PHASH | ( | table, | |||
| i | ) | PACKED_ENT((table), (i)).hash |
Definition at line 116 of file st.c.
Referenced by find_packed_index_from(), st_foreach(), and st_foreach_check().
| #define PHASH_SET | ( | table, | |||
| i, | |||||
| v | ) | (PHASH((table), (i)) = (v)) |
Definition at line 119 of file st.c.
Referenced by add_packed_direct(), and remove_safe_packed_entry().
| #define PKEY | ( | table, | |||
| i | ) | PACKED_ENT((table), (i)).key |
Definition at line 114 of file st.c.
Referenced by find_packed_index_from(), st_cleanup_safe(), st_delete(), st_delete_safe(), st_foreach(), st_foreach_check(), st_get_key(), and st_update().
| #define PKEY_SET | ( | table, | |||
| i, | |||||
| v | ) | (PKEY((table), (i)) = (v)) |
Definition at line 117 of file st.c.
Referenced by add_packed_direct(), and remove_safe_packed_entry().
| #define PTR_NOT_EQUAL | ( | table, | |||
| ptr, | |||||
| hash_val, | |||||
| key | ) | ((ptr) != 0 && ((ptr)->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key))) |
Definition at line 352 of file st.c.
Referenced by find_entry().
| #define PVAL | ( | table, | |||
| i | ) | PACKED_ENT((table), (i)).val |
Definition at line 115 of file st.c.
Referenced by st_delete(), st_delete_safe(), st_foreach(), st_foreach_check(), st_lookup(), and st_update().
| #define PVAL_SET | ( | table, | |||
| i, | |||||
| v | ) | (PVAL((table), (i)) = (v)) |
Definition at line 118 of file st.c.
Referenced by add_packed_direct(), remove_safe_packed_entry(), st_insert(), st_insert2(), and st_update().
| #define real_entries as.packed.real_entries |
Definition at line 109 of file st.c.
Referenced by find_packed_index_from(), remove_packed_entry(), st_delete(), st_delete_safe(), st_get_key(), st_insert(), st_insert2(), st_lookup(), and st_update().
| #define st_alloc_bins | ( | size | ) | (st_table_entry **)calloc(size, sizeof(st_table_entry *)) |
Definition at line 95 of file st.c.
Referenced by st_copy(), and st_init_table_with_size().
| #define st_alloc_entry | ( | ) | (st_table_entry *)malloc(sizeof(st_table_entry)) |
Definition at line 91 of file st.c.
Referenced by new_entry(), and st_copy().
| #define st_alloc_table | ( | ) | (st_table *)malloc(sizeof(st_table)) |
Definition at line 93 of file st.c.
Referenced by st_copy(), and st_init_table_with_size().
| #define st_dealloc_table | ( | table | ) | free(table) |
Definition at line 94 of file st.c.
Referenced by st_copy(), and st_free_table().
| #define ST_DEFAULT_INIT_TABLE_SIZE 11 |
Definition at line 36 of file st.c.
Referenced by unpack_entries().
| #define ST_DEFAULT_MAX_DENSITY 5 |
Definition at line 35 of file st.c.
Referenced by add_direct().
| #define st_free_bins | ( | bins, | |||
| size | ) | free(bins) |
Definition at line 96 of file st.c.
Referenced by st_free_table().
| #define st_free_entry | ( | entry | ) | free(entry) |
Definition at line 92 of file st.c.
Referenced by st_cleanup_safe(), st_clear(), st_delete(), st_foreach(), and st_update().
| #define tail as.big.tail |
Definition at line 108 of file st.c.
Referenced by bm_search(), bm_search_ic(), bm_search_notrev(), bm_search_notrev_ic(), error_print(), glob_make_pattern(), insert(), ip_ruby_cmd_receiver_const_get(), rb_file_join(), rb_w32_cmdvector(), and start_document().
| #define type_numhash st_hashtype_num |
Referenced by st_init_numtable(), and st_init_numtable_with_size().
| #define UNALIGNED_ADD | ( | n | ) |
case SIZEOF_ST_INDEX_T - (n) - 1: \ t |= data_at(n) << CHAR_BIT*(n)
| #define UNALIGNED_ADD_4 UNALIGNED_ADD(2); UNALIGNED_ADD(1); UNALIGNED_ADD(0) |
| #define UNALIGNED_ADD_ALL UNALIGNED_ADD_4 |
Referenced by st_hash().
| typedef struct st_table_entry st_table_entry |
| static void add_direct | ( | st_table * | table, | |
| st_data_t | key, | |||
| st_data_t | value, | |||
| st_index_t | hash_val, | |||
| register st_index_t | bin_pos | |||
| ) | [inline, static] |
Definition at line 488 of file st.c.
References st_table_entry::back, st_table_entry::fore, new_entry(), rehash(), and ST_DEFAULT_MAX_DENSITY.
Referenced by add_packed_direct(), st_add_direct(), st_insert(), st_insert2(), and st_update().
| static void add_packed_direct | ( | st_table * | table, | |
| st_data_t | key, | |||
| st_data_t | value, | |||
| st_index_t | hash_val | |||
| ) | [static] |
Definition at line 547 of file st.c.
References add_direct(), PHASH_SET, PKEY_SET, PVAL_SET, and unpack_entries().
Referenced by st_add_direct(), st_insert(), st_insert2(), and st_update().
| static st_table_entry* find_entry | ( | st_table * | table, | |
| st_data_t | key, | |||
| st_index_t | hash_val, | |||
| st_index_t | bin_pos | |||
| ) | [static] |
Definition at line 381 of file st.c.
References COLLISION, FOUND_ENTRY, st_table_entry::next, and PTR_NOT_EQUAL.
Referenced by st_get_key(), and st_lookup().
| static st_index_t find_packed_index | ( | st_table * | table, | |
| st_index_t | hash_val, | |||
| st_data_t | key | |||
| ) | [inline, static] |
Definition at line 406 of file st.c.
References find_packed_index_from().
Referenced by st_delete(), st_delete_safe(), st_foreach_check(), st_get_key(), st_insert(), st_insert2(), st_lookup(), and st_update().
| static st_index_t find_packed_index_from | ( | st_table * | table, | |
| st_index_t | hash_val, | |||
| st_data_t | key, | |||
| st_index_t | i | |||
| ) | [inline, static] |
Definition at line 396 of file st.c.
References EQUAL, PHASH, PKEY, and real_entries.
Referenced by find_packed_index(), and st_foreach_check().
| static st_index_t murmur | ( | st_index_t | h, | |
| st_index_t | k, | |||
| int | r | |||
| ) | [inline, static] |
| static st_index_t murmur_finish | ( | st_index_t | h | ) | [inline, static] |
Definition at line 1297 of file st.c.
References murmur(), and MurmurMagic.
Referenced by st_hash().
| static st_table_entry* new_entry | ( | st_table * | table, | |
| st_data_t | key, | |||
| st_data_t | value, | |||
| st_index_t | hash_val, | |||
| register st_index_t | bin_pos | |||
| ) | [inline, static] |
Definition at line 473 of file st.c.
References st_table_entry::hash, st_table_entry::key, st_table_entry::next, st_table_entry::record, and st_alloc_entry.
Referenced by add_direct(), and unpack_entries().
| static st_index_t new_size | ( | st_index_t | size | ) | [static] |
Definition at line 184 of file st.c.
References MINSIZE, numberof, rb_eRuntimeError, and rb_raise().
Referenced by onigenc_property_list_add_property(), rehash(), and st_init_table_with_size().
| static void rehash | ( | register st_table * | table | ) | [static] |
Definition at line 643 of file st.c.
References st_table_entry::fore, st_table_entry::hash, new_size(), st_table_entry::next, and st_realloc_bins().
| static void rehash | ( | st_table * | ) | [static] |
Referenced by add_direct().
| static void remove_entry | ( | st_table * | table, | |
| st_table_entry * | ptr | |||
| ) | [inline, static] |
Definition at line 712 of file st.c.
References st_table_entry::back, and st_table_entry::fore.
Referenced by st_delete(), st_delete_safe(), st_foreach(), st_foreach_check(), and st_update().
| static void remove_packed_entry | ( | st_table * | table, | |
| st_index_t | i | |||
| ) | [inline, static] |
Definition at line 123 of file st.c.
References MEMMOVE, PACKED_ENT, and real_entries.
Referenced by st_delete(), st_foreach(), and st_update().
| static void remove_safe_packed_entry | ( | st_table * | table, | |
| st_index_t | i, | |||
| st_data_t | never | |||
| ) | [inline, static] |
Definition at line 134 of file st.c.
References PHASH_SET, PKEY_SET, and PVAL_SET.
Referenced by st_delete_safe(), and st_foreach_check().
| void st_add_direct | ( | st_table * | table, | |
| st_data_t | key, | |||
| st_data_t | value | |||
| ) |
Definition at line 629 of file st.c.
References add_direct(), add_packed_direct(), and do_hash.
Referenced by boot_defclass(), define_final0(), generic_ivar_set(), make_transcoder_entry(), method_entry_i(), move_refined_method(), rb_alias_variable(), rb_autoload(), rb_copy_generic_ivar(), rb_define_class(), rb_define_module(), rb_global_entry(), rb_ivar_set(), register_symid_str(), set_syserr(), transcode_search_path(), transcode_search_path_i(), w_object(), and w_symbol().
| void st_cleanup_safe | ( | st_table * | table, | |
| st_data_t | never | |||
| ) |
Definition at line 802 of file st.c.
References st_table_entry::key, last, st_table_entry::next, PACKED_ENT, PKEY, and st_free_entry.
Referenced by hash_foreach_ensure().
| void st_clear | ( | st_table * | table | ) |
Definition at line 308 of file st.c.
References st_table_entry::next, and st_free_entry.
Referenced by rb_hash_clear(), rb_hash_initialize_copy(), rb_thread_atfork_internal(), and st_free_table().
| st_table* st_copy | ( | st_table * | old_table | ) |
Definition at line 663 of file st.c.
References st_table_entry::back, st_table_entry::fore, st_table_entry::hash, MEMCPY, st_table_entry::next, prev, st_alloc_bins, st_alloc_entry, st_alloc_table, st_dealloc_table, and st_free_table().
Referenced by init_copy(), rb_copy_generic_ivar(), rb_hash_dup(), rb_hash_initialize_copy(), rb_hash_s_create(), rb_hash_to_h(), rb_mod_init_copy(), and rb_singleton_class_clone_and_attach().
| int st_delete | ( | register st_table * | table, | |
| register st_data_t * | key, | |||
| st_data_t * | value | |||
| ) |
Definition at line 729 of file st.c.
References do_hash, EQUAL, find_packed_index(), st_table_entry::key, st_table_entry::next, PKEY, prev, PVAL, real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), and st_free_entry.
Referenced by autoload_delete(), constat_delete(), find_class_path(), flatten(), generic_ivar_remove(), r_leave(), rb_ary_and(), rb_ary_or(), rb_ary_uniq(), rb_ary_uniq_bang(), rb_const_remove(), rb_const_set(), rb_cvar_get(), rb_cvar_set(), rb_execarg_fixup(), rb_free_generic_ivar(), rb_hash_delete_key(), rb_mod_init_copy(), rb_mod_remove_cvar(), rb_obj_remove_instance_variable(), rb_objspace_call_finalizer(), rb_undefine_final(), rb_waitpid(), remove_method(), run_final(), socklist_delete(), st_delete_wrap(), unknown_keyword_error(), and wmap_finalize().
| int st_delete_safe | ( | register st_table * | table, | |
| register st_data_t * | key, | |||
| st_data_t * | value, | |||
| st_data_t | never | |||
| ) |
Definition at line 766 of file st.c.
References do_hash, EQUAL, find_packed_index(), st_table_entry::key, st_table_entry::next, PKEY, PVAL, real_entries, st_table_entry::record, remove_entry(), and remove_safe_packed_entry().
Referenced by rb_hash_delete_key().
| int st_foreach | ( | st_table * | table, | |
| int(*)(ANYARGS) | func, | |||
| st_data_t | arg | |||
| ) |
Definition at line 1006 of file st.c.
References FIND_ENTRY, st_table_entry::fore, st_table_entry::hash, hash(), st_table_entry::key, last, st_table_entry::next, PHASH, PKEY, PVAL, st_table_entry::record, remove_entry(), remove_packed_entry(), st_free_entry, and val.
Referenced by class_instance_method_list(), clear_coverage(), count_nodes(), count_objects(), count_objects_size(), count_tdata_objects(), enc_names(), exit_handler(), extract_keywords(), fc_i(), get_loaded_features_index(), include_modules_at(), mark_const_tbl(), mark_hash(), mark_m_tbl(), mark_marshal_compat_t(), mark_set(), mark_tbl(), proc_waitall(), rb_ary_uniq(), rb_ary_uniq_bang(), rb_check_deadlock(), rb_check_exec_env(), rb_check_exec_options(), rb_clear_trace_func(), rb_coverage_result(), rb_econv_asciicompat_encoding(), rb_enc_aliases(), rb_enc_name_list(), rb_execarg_extract_options(), rb_execarg_fixup(), rb_feature_p(), rb_free_const_table(), rb_free_m_table(), rb_mod_init_copy(), rb_obj_singleton_methods(), rb_objspace_call_finalizer(), rb_prepend_module(), rb_singleton_class_clone_and_attach(), rb_sym_all_symbols(), rb_thread_atfork_internal(), rb_thread_fd_close(), rb_thread_keys(), rb_thread_list(), rb_thread_terminate_all(), rb_vm_check_redefinition_by_prepend(), rb_vm_mark(), rb_waitpid(), reachable_objects_from(), thgroup_list(), transcode_search_path(), validate_labels(), wmap_free(), wmap_mark(), and wmap_memsize().
| int st_foreach_check | ( | st_table * | table, | |
| int(*)(ANYARGS) | func, | |||
| st_data_t | arg, | |||
| st_data_t | never | |||
| ) |
Definition at line 914 of file st.c.
References FIND_ENTRY, find_packed_index(), find_packed_index_from(), st_table_entry::fore, st_table_entry::hash, hash(), st_table_entry::key, last, st_table_entry::next, PHASH, PKEY, PVAL, st_table_entry::record, remove_entry(), remove_safe_packed_entry(), and val.
Referenced by hash2kv(), hash2kv_enc(), hash_foreach_call(), st_foreach_safe(), and tk_symbolkey2str().
| void st_free_table | ( | st_table * | table | ) |
Definition at line 334 of file st.c.
References st_clear(), st_dealloc_table, and st_free_bins.
Referenced by ary_recycle_hash(), autoload_free(), class_instance_method_list(), clear_dump_arg(), clear_load_arg(), cvar_list(), exit_handler(), fiber_free(), flatten(), free_enc2cp(), generic_ivar_remove(), init_copy(), Init_win32ole(), iseq_build_from_ary_body(), iseq_data_to_ary(), iseq_load(), obj_free(), rb_const_list(), rb_copy_generic_ivar(), rb_free_const_table(), rb_free_generic_ivar(), rb_free_m_table(), rb_hash_initialize_copy(), rb_hash_rehash(), rb_mod_init_copy(), rb_obj_singleton_methods(), rb_objspace_call_finalizer(), ruby_vm_destruct(), st_copy(), thread_free(), transcode_search_path(), and wmap_free().
| int st_get_key | ( | st_table * | table, | |
| register st_data_t | key, | |||
| st_data_t * | result | |||
| ) |
Definition at line 442 of file st.c.
References do_hash, find_entry(), find_packed_index(), st_table_entry::key, PKEY, and real_entries.
Referenced by rb_feature_p().
| st_index_t st_hash | ( | const void * | ptr, | |
| size_t | len, | |||
| st_index_t | h | |||
| ) |
Definition at line 1319 of file st.c.
References CHAR_BIT, murmur_finish(), murmur_step, MurmurMagic, SIZEOF_ST_INDEX_T, t(), and UNALIGNED_ADD_ALL.
| st_index_t st_hash_end | ( | st_index_t | h | ) |
Definition at line 1483 of file st.c.
References murmur_step.
| st_index_t st_hash_start | ( | st_index_t | h | ) |
Definition at line 1492 of file st.c.
References st_hash_start.
| st_index_t st_hash_uint | ( | st_index_t | h, | |
| st_index_t | i | |||
| ) |
| st_index_t st_hash_uint32 | ( | st_index_t | h, | |
| uint32_t | i | |||
| ) |
Definition at line 1446 of file st.c.
References murmur_step.
| st_table* st_init_numtable | ( | void | ) |
Definition at line 272 of file st.c.
References st_init_table(), and type_numhash.
Referenced by class_instance_method_list(), constat_handle(), fiber_init(), find_class_path(), flatten(), generic_ivar_set(), init_enc2cp(), Init_Exception(), init_heap(), Init_marshal(), Init_var_tables(), Init_VM(), Init_win32ole(), insn_make_insn_table(), iseq_compile_each(), iseq_data_to_ary(), iseq_load(), marshal_dump(), marshal_load(), mod_cvar_at(), rb_autoload(), rb_class_boot(), rb_const_set(), rb_cvar_set(), rb_include_class_new(), rb_iseq_build_from_ary(), rb_ivar_set(), rb_mod_const_at(), rb_mod_init_copy(), rb_module_new(), rb_obj_freeze(), rb_obj_singleton_methods(), rb_prepend_module(), rb_singleton_class_attached(), rb_singleton_class_clone_and_attach(), rb_thread_local_aset(), rb_waitpid(), reachable_objects_from(), socklist_insert(), vm_init_redefined_flag(), and wmap_allocate().
| st_table* st_init_numtable_with_size | ( | st_index_t | size | ) |
Definition at line 278 of file st.c.
References st_init_table_with_size(), and type_numhash.
Referenced by Init_sym().
| st_table* st_init_strcasetable | ( | void | ) |
Definition at line 296 of file st.c.
References st_init_table().
Referenced by Init_transcode(), make_transcoder_entry(), rb_enc_init(), transcode_search_path(), and w_encoding().
| st_table* st_init_strcasetable_with_size | ( | st_index_t | size | ) |
Definition at line 302 of file st.c.
References st_init_table_with_size().
| st_table* st_init_strtable | ( | void | ) |
Definition at line 284 of file st.c.
References st_init_table().
Referenced by Init_load(), load_lock(), ruby_init_ext(), and zone_str().
| st_table* st_init_strtable_with_size | ( | st_index_t | size | ) |
Definition at line 290 of file st.c.
References st_init_table_with_size().
| st_table* st_init_table | ( | const struct st_hash_type * | type | ) |
Definition at line 266 of file st.c.
References st_init_table_with_size().
Referenced by rb_hash_tbl(), st_init_numtable(), st_init_strcasetable(), and st_init_strtable().
| st_table* st_init_table_with_size | ( | const struct st_hash_type * | type, | |
| st_index_t | size | |||
| ) |
Definition at line 229 of file st.c.
References getenv(), new_size(), st_alloc_bins, and st_alloc_table.
Referenced by Init_sym(), rb_hash_rehash(), st_init_numtable_with_size(), st_init_strcasetable_with_size(), st_init_strtable_with_size(), and st_init_table().
| int st_insert | ( | register st_table * | table, | |
| register st_data_t | key, | |||
| st_data_t | value | |||
| ) |
Definition at line 564 of file st.c.
References add_direct(), add_packed_direct(), do_hash, FIND_ENTRY, find_packed_index(), PVAL_SET, real_entries, and st_table_entry::record.
Referenced by add_opt_method(), clone_const(), constat_handle(), cv_i(), enc_register_at(), enc_set_default_encoding(), features_index_add_single(), find_class_path(), flatten(), generic_ivar_set(), Init_VM(), insn_make_insn_table(), iseq_compile_each(), iseq_load(), load_lock(), obj_alloc_by_klass(), ole_vstr2wc(), r_entry0(), r_prepare(), r_symreal(), rb_autoload(), rb_const_set(), rb_copy_generic_ivar(), rb_cvar_set(), rb_execarg_fixup(), rb_gc_copy_finalizer(), rb_hash_rehash_i(), rb_ivar_set(), rb_marshal_define_compat(), rb_method_entry_make(), rb_obj_freeze(), rb_singleton_class_attached(), rb_thread_atfork_internal(), rb_thread_local_aset(), rb_waitpid(), reachable_object_from_i(), register_label(), socklist_insert(), sv_i(), thread_create_core(), w_encoding(), w_object(), and wmap_aset().
| int st_insert2 | ( | register st_table * | table, | |
| register st_data_t | key, | |||
| st_data_t | value, | |||
| st_data_t(*)(st_data_t) | func | |||
| ) |
Definition at line 595 of file st.c.
References add_direct(), add_packed_direct(), do_hash, FIND_ENTRY, find_packed_index(), PVAL_SET, real_entries, and st_table_entry::record.
Referenced by enc_alias_internal().
| int st_lookup | ( | st_table * | table, | |
| register st_data_t | key, | |||
| st_data_t * | value | |||
| ) |
Definition at line 414 of file st.c.
References do_hash, find_entry(), find_packed_index(), PVAL, real_entries, and st_table_entry::record.
Referenced by add_opt_method(), autoload_data(), autoload_defined_p(), autoload_delete(), classname(), constat_handle(), constat_reset(), cv_i(), cvar_lookup_at(), define_final0(), eql_i(), fc_path(), features_index_add_single(), flatten(), generic_ivar_defined(), generic_ivar_get(), generic_ivar_remove(), generic_ivar_set(), get_syserr(), get_transcoder_entry(), iseq_build_from_ary_body(), iseq_compile_each(), iseq_data_to_ary(), iseq_load(), ivar_get(), load_lock(), lookup_method_table(), make_transcoder_entry(), method_entry_i(), obj_alloc_by_klass(), ole_vstr2wc(), r_entry0(), r_leave(), r_object0(), r_symlink(), rb_alias_variable(), rb_ary_diff(), rb_autoload(), rb_check_id(), rb_check_id_cstr(), rb_const_defined_0(), rb_const_get_0(), rb_const_set(), rb_copy_generic_ivar(), rb_econv_asciicompat_encoding(), rb_enc_registered(), rb_f_untrace_var(), rb_feature_p(), rb_gc_copy_finalizer(), rb_generic_ivar_memsize(), rb_generic_ivar_table(), rb_global_entry(), rb_hash_aref(), rb_hash_fetch_m(), rb_hash_has_key(), rb_hash_lookup2(), rb_id2str(), rb_intern3(), rb_intern_str(), rb_ivar_count(), rb_ivar_defined(), rb_ivar_foreach(), rb_ivar_set(), rb_mark_generic_ivar(), rb_method_entry_make(), rb_obj_frozen_p(), rb_obj_remove_instance_variable(), rb_thread_key_p(), rb_thread_local_aref(), rb_thread_variable_p(), rb_tmp_class_path(), rb_vm_check_redefinition_opt_method(), register_label(), remove_method(), set_const_visibility(), set_syserr(), socklist_lookup(), sv_i(), syserr_initialize(), transcode_search_path(), transcode_search_path_i(), vm_callee_setup_keyword_arg(), vm_get_ev_const(), vm_getivar(), vm_setivar(), w_class(), w_encoding(), w_object(), w_symbol(), wmap_aref(), and wmap_aset().
| size_t st_memsize | ( | const st_table * | table | ) |
Definition at line 342 of file st.c.
Referenced by autoload_memsize(), fiber_memsize(), memsize_of(), rb_generic_ivar_memsize(), thread_memsize(), vm_memsize(), and wmap_memsize().
| int st_numcmp | ( | st_data_t | x, | |
| st_data_t | y | |||
| ) |
Definition at line 1575 of file st.c.
Referenced by STATIC_ASSERT().
| st_index_t st_numhash | ( | st_data_t | n | ) |
Definition at line 1581 of file st.c.
Referenced by STATIC_ASSERT().
| static st_table_entry** st_realloc_bins | ( | st_table_entry ** | bins, | |
| st_index_t | newsize, | |||
| st_index_t | oldsize | |||
| ) | [inline, static] |
| int st_strncasecmp | ( | const char * | s1, | |
| const char * | s2, | |||
| size_t | n | |||
| ) |
| int st_update | ( | st_table * | table, | |
| st_data_t | key, | |||
| st_update_callback_func * | func, | |||
| st_data_t | arg | |||
| ) |
Definition at line 839 of file st.c.
References add_direct(), add_packed_direct(), do_hash, FIND_ENTRY, find_packed_index(), st_table_entry::fore, st_table_entry::key, last, st_table_entry::next, PKEY, PVAL, PVAL_SET, real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), and st_free_entry.
Referenced by kwmerge_i(), load_unlock(), ruby_init_ext(), wmap_finalize(), and zone_str().
| STATIC_ASSERT | ( | st_packed_entry | , | |
| sizeof(st_packed_entry) | = = sizeof(st_table_entry*[PACKED_UNIT]) | |||
| ) |
Definition at line 42 of file st.c.
References st_hashtype_num, st_numcmp(), and st_numhash().
| static st_index_t strcasehash | ( | st_data_t | arg | ) | [static] |
Definition at line 1555 of file st.c.
References FNV1_32A_INIT, and FNV_32_PRIME.
| static st_index_t strhash | ( | st_data_t | arg | ) | [static] |
Definition at line 1498 of file st.c.
References FNV1_32A_INIT, st_hash(), and strlen().
| static void unpack_entries | ( | register st_table * | table | ) | [static] |
Definition at line 512 of file st.c.
References st_table_entry::back, st_table_entry::fore, st_packed_entry::hash, hash(), st_packed_entry::key, key, MEMCPY, MEMZERO, new_entry(), NULL, PACKED_BINS, ST_DEFAULT_INIT_TABLE_SIZE, st_realloc_bins(), st_packed_entry::val, and val.
Referenced by add_packed_direct().
struct st_hash_type type_strcasehash [static] |
{
st_strcasecmp,
strcasehash,
}
struct st_hash_type type_strhash [static] |
1.6.1