Ruby
2.0.0p353(2013-11-22revision43784)
|
#include "ruby/defines.h"
Go to the source code of this file.
Data Structures | |
struct | st_hash_type |
struct | st_table |
Macros | |
#define | ST_DATA_T_DEFINED |
#define | CHAR_BIT 8 |
#define | SIZEOF_ST_INDEX_T SIZEOF_VOIDP |
#define | ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT) |
#define | st_is_member(table, key) st_lookup((table),(key),(st_data_t *)0) |
#define | st_hash_start(h) ((st_index_t)(h)) |
Typedefs | |
typedef unsigned long | st_data_t |
typedef struct st_table | st_table |
typedef st_data_t | st_index_t |
typedef int | st_compare_func(st_data_t, st_data_t) |
typedef st_index_t | st_hash_func(st_data_t) |
typedef char | st_check_for_sizeof_st_index_t[SIZEOF_VOIDP==(int) sizeof(st_index_t)?1:-1] |
typedef int | st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing) |
Enumerations | |
enum | st_retval { ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK } |
#define st_hash_start | ( | h | ) | ((st_index_t)(h)) |
Definition at line 144 of file st.h.
Referenced by rb_hash_start().
#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT) |
typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP==(int) sizeof(st_index_t)?1:-1] |
typedef st_index_t st_hash_func(st_data_t) |
typedef st_data_t st_index_t |
enum st_retval |
Definition at line 624 of file st.c.
References add_direct(), add_packed_direct(), do_hash, st_table::entries_packed, and st_table::num_bins.
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().
Definition at line 797 of file st.c.
References st_table::bins, st_table::entries_packed, i, st_table_entry::key, last, st_table_entry::next, st_table::num_bins, st_table::num_entries, PACKED_ENT, PKEY, st_table::real_entries, and st_free_entry.
Referenced by hash_foreach_ensure().
void st_clear | ( | st_table * | ) |
Definition at line 308 of file st.c.
References st_table::bins, st_table::entries_packed, st_table::head, i, st_table_entry::next, st_table::num_bins, st_table::num_entries, st_table::real_entries, st_free_entry, and st_table::tail.
Referenced by rb_hash_clear(), rb_thread_atfork_internal(), and st_free_table().
Definition at line 658 of file st.c.
References st_table_entry::back, st_table::bins, st_table::entries_packed, st_table_entry::fore, st_table_entry::hash, st_table::head, MEMCPY, st_table_entry::next, st_table::num_bins, st_alloc_bins, st_alloc_entry, st_alloc_table, st_dealloc_table, st_free_table(), and st_table::tail.
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().
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_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(), and wmap_finalize().
Referenced by rb_hash_delete_key().
Definition at line 1000 of file st.c.
References st_table::bins, st_table::entries_packed, FIND_ENTRY, st_table_entry::fore, st_table_entry::hash, hash(), st_table::head, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PHASH, PKEY, PVAL, st_table::real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), ST_CHECK, ST_CONTINUE, ST_DELETE, st_free_entry, ST_STOP, 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().
Definition at line 909 of file st.c.
References st_table::bins, st_table::entries_packed, FIND_ENTRY, find_packed_index(), st_table_entry::fore, st_table_entry::hash, hash(), st_table::head, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PHASH, PKEY, PVAL, st_table::real_entries, st_table_entry::record, remove_entry(), remove_safe_packed_entry(), ST_CHECK, ST_CONTINUE, ST_DELETE, ST_STOP, and val.
Referenced by hash2kv(), hash2kv_enc(), hash_foreach_call(), st_foreach_safe(), and tk_symbolkey2str().
void st_free_table | ( | st_table * | ) |
Definition at line 334 of file st.c.
References st_table::bins, st_table::num_bins, 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(), obj_free(), rb_const_list(), rb_copy_generic_ivar(), rb_free_const_table(), rb_free_generic_ivar(), rb_free_m_table(), 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().
Referenced by rb_feature_p().
st_index_t st_hash | ( | const void * | ptr, |
size_t | len, | ||
st_index_t | h | ||
) |
Definition at line 1313 of file st.c.
References CHAR_BIT, murmur_finish(), murmur_step, MurmurMagic, SIZEOF_ST_INDEX_T, and UNALIGNED_ADD_ALL.
st_index_t st_hash_end | ( | st_index_t | h | ) |
Definition at line 1477 of file st.c.
References murmur_step.
st_index_t st_hash_start | ( | st_index_t | h | ) |
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 1440 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_constants(), 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 | ) |
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 | ) |
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 | ) |
Definition at line 290 of file st.c.
References st_init_table_with_size().
st_table* st_init_table | ( | const struct st_hash_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 * | , |
st_index_t | |||
) |
Definition at line 229 of file st.c.
References st_table::bins, st_table::entries_packed, getenv(), st_table::head, MAX_PACKED_HASH, new_size(), st_table::num_bins, st_table::num_entries, size, st_alloc_bins, st_alloc_table, ST_DEFAULT_PACKED_TABLE_SIZE, st_table::tail, st_table::type, and type.
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().
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_constants(), 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(), val2dispatch(), w_encoding(), w_object(), and wmap_aset().
Referenced by enc_alias_internal().
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(), rsock_intern_family(), rsock_intern_family_noprefix(), rsock_intern_ip_optname(), rsock_intern_iplevel(), rsock_intern_ipproto(), rsock_intern_ipv6_optname(), rsock_intern_local_optname(), rsock_intern_protocol_family(), rsock_intern_scm_optname(), rsock_intern_so_optname(), rsock_intern_socktype(), rsock_intern_tcp_optname(), rsock_intern_udp_optname(), set_const_visibility(), set_syserr(), socklist_lookup(), sv_i(), syserr_initialize(), transcode_search_path(), transcode_search_path_i(), val2dispatch(), 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().
Definition at line 342 of file st.c.
References st_table::entries_packed, st_table::num_bins, and st_table::num_entries.
Referenced by autoload_memsize(), fiber_memsize(), memsize_of(), rb_generic_ivar_memsize(), thread_memsize(), vm_memsize(), and wmap_memsize().
Definition at line 1569 of file st.c.
Referenced by STATIC_ASSERT().
st_index_t st_numhash | ( | st_data_t | ) |
Definition at line 1575 of file st.c.
Referenced by STATIC_ASSERT().
int st_update | ( | st_table * | table, |
st_data_t | key, | ||
st_update_callback_func * | func, | ||
st_data_t | arg | ||
) |
Definition at line 834 of file st.c.
References add_direct(), add_packed_direct(), st_table::bins, do_hash, st_table::entries_packed, FIND_ENTRY, find_packed_index(), st_table_entry::fore, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PKEY, PVAL, PVAL_SET, real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), ST_CONTINUE, ST_DELETE, and st_free_entry.
Referenced by kwmerge_i(), load_unlock(), ruby_init_ext(), wmap_finalize(), and zone_str().