Blender
V3.3
|
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BLI_hash_mm2a.h"
#include "BLI_utildefines.h"
#include "BLI_strict_flags.h"
Go to the source code of this file.
Functions | |
Generic Key Hash & Comparison Functions | |
uint | BLI_ghashutil_ptrhash (const void *key) |
bool | BLI_ghashutil_ptrcmp (const void *a, const void *b) |
uint | BLI_ghashutil_uinthash_v4 (const uint key[4]) |
uint | BLI_ghashutil_uinthash_v4_murmur (const uint key[4]) |
bool | BLI_ghashutil_uinthash_v4_cmp (const void *a, const void *b) |
uint | BLI_ghashutil_uinthash (uint key) |
uint | BLI_ghashutil_inthash_p (const void *ptr) |
uint | BLI_ghashutil_inthash_p_murmur (const void *ptr) |
uint | BLI_ghashutil_inthash_p_simple (const void *ptr) |
bool | BLI_ghashutil_intcmp (const void *a, const void *b) |
size_t | BLI_ghashutil_combine_hash (size_t hash_a, size_t hash_b) |
uint | BLI_ghashutil_strhash_n (const char *key, size_t n) |
uint | BLI_ghashutil_strhash_p (const void *ptr) |
uint | BLI_ghashutil_strhash_p_murmur (const void *ptr) |
bool | BLI_ghashutil_strcmp (const void *a, const void *b) |
GHashPair * | BLI_ghashutil_pairalloc (const void *first, const void *second) |
uint | BLI_ghashutil_pairhash (const void *ptr) |
bool | BLI_ghashutil_paircmp (const void *a, const void *b) |
void | BLI_ghashutil_pairfree (void *ptr) |
Convenience GHash Creation Functions | |
GHash * | BLI_ghash_ptr_new_ex (const char *info, const uint nentries_reserve) |
GHash * | BLI_ghash_ptr_new (const char *info) |
GHash * | BLI_ghash_str_new_ex (const char *info, const uint nentries_reserve) |
GHash * | BLI_ghash_str_new (const char *info) |
GHash * | BLI_ghash_int_new_ex (const char *info, const uint nentries_reserve) |
GHash * | BLI_ghash_int_new (const char *info) |
GHash * | BLI_ghash_pair_new_ex (const char *info, const uint nentries_reserve) |
GHash * | BLI_ghash_pair_new (const char *info) |
Convenience GSet Creation Functions | |
GSet * | BLI_gset_ptr_new_ex (const char *info, const uint nentries_reserve) |
GSet * | BLI_gset_ptr_new (const char *info) |
GSet * | BLI_gset_str_new_ex (const char *info, const uint nentries_reserve) |
GSet * | BLI_gset_str_new (const char *info) |
GSet * | BLI_gset_pair_new_ex (const char *info, const uint nentries_reserve) |
GSet * | BLI_gset_pair_new (const char *info) |
GSet * | BLI_gset_int_new_ex (const char *info, const uint nentries_reserve) |
GSet * | BLI_gset_int_new (const char *info) |
Helper functions and implementations of standard data types for GHash (not its implementation).
Definition in file BLI_ghash_utils.c.
GHash* BLI_ghash_int_new | ( | const char * | info | ) |
Definition at line 211 of file BLI_ghash_utils.c.
References BLI_ghash_int_new_ex().
Referenced by BKE_gpencil_merge_materials(), BKE_gpencil_merge_materials_table_get(), BKE_icons_init(), BKE_main_idmap_create(), BM_mesh_intersect(), bm_uuidwalk_init(), GEO_uv_prepare_pin_index(), gpencil_bake_grease_pencil_animation_exec(), gpencil_copybuf_validate_colormap(), gpencil_extract_palette_from_vertex(), gpencil_generate_edgeloops(), gpencil_select_vertex_color_exec(), gpencil_strokes_copy_exec(), modifyMesh(), and palette_extract_img_exec().
Definition at line 207 of file BLI_ghash_utils.c.
References BLI_ghash_new_ex(), BLI_ghashutil_intcmp(), and BLI_ghashutil_inthash_p().
Referenced by BKE_gpencil_stroke_copy_to_keyframes(), BLI_ghash_int_new(), bm_log_compress_ids_to_indices(), build_mesh_leaf_node(), ED_gpencil_layer_merge(), gpencil_fill_modal(), GPU_pbvh_bmesh_buffers_update(), make_duplis_font(), and objfnt_to_ftvfontdata().
GHash* BLI_ghash_pair_new | ( | const char * | info | ) |
Definition at line 220 of file BLI_ghash_utils.c.
References BLI_ghash_pair_new_ex().
Definition at line 216 of file BLI_ghash_utils.c.
References BLI_ghash_new_ex(), BLI_ghashutil_paircmp(), and BLI_ghashutil_pairhash().
Referenced by BLI_ghash_pair_new().
GHash* BLI_ghash_ptr_new | ( | const char * | info | ) |
Definition at line 193 of file BLI_ghash_utils.c.
References BLI_ghash_ptr_new_ex().
Referenced by BKE_mask_clipboard_copy_from_layer(), BKE_tracking_copy(), Freestyle::BlenderStrokeRenderer::BlenderStrokeRenderer(), BLI_array_store_is_valid(), bm_edgering_pair_calc(), bm_edgering_pair_store_create(), bm_face_region_pivot_edge_find(), BM_mesh_bevel(), BM_mesh_edgesplit(), BM_mesh_intersect(), BM_select_history_map_create(), bmo_inset_region_exec(), bmo_mesh_copy(), bmo_op_slots_init(), bmo_weld_verts_exec(), BPY_rna_init(), cloth_sim_initialize_default_node_state(), ED_gpencil_select_stroke_segment(), ED_object_data_xform_container_create(), ED_object_data_xform_container_item_ensure(), ED_object_xform_skip_child_container_create(), edbm_face_split_by_edges_exec(), EEVEE_materials_cache_init(), gpencil_analyze_strokes(), gpencil_interpolate_seq_exec(), gpencil_sculpt_brush_apply_event(), gpencil_sculpt_brush_init(), gpencil_stroke_pair_table(), gpencil_strokes_copypastebuf_colors_material_to_name_create(), init_editNurb_keyIndex(), init_stabilization_working_context(), knife_add_cut(), knifetool_init(), last_displayed_thumbnails_list_ensure(), lib_override_library_main_resync_on_library_indirect_level(), make_object_duplilist_real(), menu_items_from_ui_create(), OVERLAY_armature_cache_init(), pbvh_bmesh_collapse_short_edges(), recalcData_gpencil_strokes(), sb_new_scratch(), scanfill_preprocess_self_isect(), seq_sequence_lookup_init(), sequencer_thumbnail_ghash_init(), tc_mesh_customdatacorrect_init_container_generic(), tracks_map_new(), WM_gizmomap_gizmo_hash_new(), workbench_opaque_cache_init(), and workbench_transparent_cache_init().
GHash* BLI_ghash_ptr_new_ex | ( | const char * | info, |
unsigned int | nentries_reserve | ||
) |
Wrapper GHash Creation Functions
Definition at line 189 of file BLI_ghash_utils.c.
References BLI_ghash_new_ex(), BLI_ghashutil_ptrcmp(), and BLI_ghashutil_ptrhash().
Referenced by armature_dissolve_selected_exec(), BKE_object_material_remap_calc(), BLI_ghash_ptr_new(), BM_log_create(), BM_mesh_remap(), bmo_planar_faces_exec(), bmo_triangle_fill_exec(), createTransObject(), ED_curve_keyindex_hash_duplicate(), filelist_cache_init(), mesh_undostep_reference_elems_from_objects(), and tc_mesh_customdatacorrect_init_container_merge_group().
GHash* BLI_ghash_str_new | ( | const char * | info | ) |
Definition at line 202 of file BLI_ghash_utils.c.
References BLI_ghash_str_new_ex().
Referenced by BKE_addon_pref_type_init(), BKE_icons_init(), BKE_keyconfig_pref_type_init(), BKE_nlastrip_validate_name(), BKE_node_system_init(), BKE_pose_channels_hash_ensure(), BKE_view_layer_verify_aov(), ED_armature_join_objects_exec(), ED_gpencil_join_objects_exec(), gpencil_strokes_copypastebuf_colors_name_to_material_create(), nlaeval_init(), postEditBoneDuplicate(), read_library_linked_ids(), RNA_init(), seq_sequence_lookup_init(), text_autocomplete_build(), and UI_block_region_set().
Definition at line 198 of file BLI_ghash_utils.c.
References BLI_ghash_new_ex(), BLI_ghashutil_strcmp(), and BLI_ghashutil_strhash_p().
Referenced by armature_bone_from_name_map(), BKE_fcurve_pathcache_create(), BKE_object_defgroup_validmap_get(), BLI_ghash_str_new(), DNA_alias_maps(), DNA_sdna_alias_data_ensure_structs_map(), fsmenu_xdg_user_dirs_parse(), init_structDNA(), read_file_bhead_idname_map_create(), RNA_create(), RNA_init(), wm_gizmogrouptype_init(), wm_gizmotype_init(), WM_menutype_init(), wm_operatortype_init(), WM_paneltype_init(), and WM_uilisttype_init().
size_t BLI_ghashutil_combine_hash | ( | size_t | hash_a, |
size_t | hash_b | ||
) |
Definition at line 117 of file BLI_ghash_utils.c.
Referenced by BKE_idtype_cache_key_hash(), blender::compositor::NodeOperation::combine_hashes(), eevee_object_key_hash(), Uniqueness_Key::hash(), blender::deg::ComponentNode::OperationIDKey::hash(), blender::deg::IDNode::ComponentIDKey::hash(), and blender::eevee::ObjectKey::ObjectKey().
Definition at line 112 of file BLI_ghash_utils.c.
References Freestyle::a, and usdtokens::b().
Referenced by BLI_ghash_int_new_ex(), BLI_gset_int_new_ex(), BLO_memfile_write_init(), filelist_cache_init(), filelist_new(), keycmp(), make_override_library_exec(), and TEST().
Definition at line 86 of file BLI_ghash_utils.c.
References ptr.
Referenced by BLI_ghash_int_new_ex(), BLI_gset_int_new_ex(), filelist_cache_init(), filelist_new(), make_override_library_exec(), and TEST().
Definition at line 100 of file BLI_ghash_utils.c.
References BLI_hash_mm2(), and ptr.
Referenced by TEST().
Definition at line 107 of file BLI_ghash_utils.c.
References POINTER_AS_UINT, and ptr.
Referenced by BLO_memfile_write_init().
Definition at line 155 of file BLI_ghash_utils.c.
References GHashPair::first, MEM_mallocN, and GHashPair::second.
Referenced by bm_edgering_pair_calc().
Definition at line 170 of file BLI_ghash_utils.c.
References A, Freestyle::a, B, and usdtokens::b().
Referenced by BLI_ghash_pair_new_ex(), and BLI_gset_pair_new_ex().
Definition at line 178 of file BLI_ghash_utils.c.
Definition at line 163 of file BLI_ghash_utils.c.
References BLI_ghashutil_ptrhash(), GHashPair::first, hash, ptr, and GHashPair::second.
Referenced by BLI_ghash_pair_new_ex(), and BLI_gset_pair_new_ex().
Definition at line 46 of file BLI_ghash_utils.c.
References Freestyle::a, and usdtokens::b().
Referenced by BKE_main_gset_create(), BKE_main_relations_create(), BLI_ghash_ptr_new_ex(), BLI_gset_ptr_new_ex(), BLO_memfile_merge(), EEVEE_motion_blur_data_init(), GPU_material_from_nodetree(), lib_override_group_tag_data_object_to_collection_init(), lib_override_library_resync(), library_foreach_ID_link(), new_id_to_item_mapping_create(), select_more_less_seq__internal(), selected_items_init(), SEQ_collection_create(), stats_update(), and view_layer_bases_hash_create().
Callbacks for GHash (BLI_ghashutil_
)
Definition at line 33 of file BLI_ghash_utils.c.
References y.
Referenced by BKE_main_gset_create(), BKE_main_relations_create(), BLI_ghash_ptr_new_ex(), BLI_ghashutil_pairhash(), BLI_gset_ptr_new_ex(), BLO_memfile_merge(), depsgraph_key_hash(), dupli_key_hash(), dupliobject_hash(), EEVEE_motion_blur_data_init(), eevee_object_key_hash(), GPU_material_from_nodetree(), Uniqueness_Key::hash(), idkey_hash(), lib_override_group_tag_data_object_to_collection_init(), lib_override_library_resync(), library_foreach_ID_link(), new_id_to_item_mapping_create(), nlaevalchan_keyhash(), blender::eevee::ObjectKey::ObjectKey(), select_more_less_seq__internal(), selected_items_init(), SEQ_collection_create(), stats_update(), tse_hash(), and view_layer_bases_hash_create().
Definition at line 150 of file BLI_ghash_utils.c.
References Freestyle::a, usdtokens::b(), and STREQ.
Referenced by BKE_scene_undo_depsgraphs_extract(), BLI_ghash_str_new_ex(), BLI_gset_str_new_ex(), ensure_ed_screen_context_functions(), make(), UniqueName_Key::operator==(), Uniqueness_Key::operator==(), override_library_rna_path_mapping_ensure(), seq_proxy_build_job(), sequencer_rebuild_proxy_exec(), TEST(), and wm_link_append_exec().
uint BLI_ghashutil_strhash_n | ( | const char * | key, |
size_t | n | ||
) |
This function implements the widely used djb
hash apparently posted by Daniel Bernstein to comp.lang.c
some time ago. The 32 bit unsigned hash value starts at 5381 and for each byte 'c' in the string, is updated: hash = hash * 33 + c
. This function uses the signed value of each byte.
NOTE: this is the same hash method that glib 2.34.0 uses.
Definition at line 122 of file BLI_ghash_utils.c.
Referenced by UniqueName_Key::hash(), Uniqueness_Key::hash(), and ui_popup_string_hash().
Definition at line 133 of file BLI_ghash_utils.c.
References ptr.
Referenced by BKE_scene_undo_depsgraphs_extract(), BKE_sim_debug_data_add_element(), BKE_sim_debug_data_clear_category(), BLI_ghash_str_new_ex(), BLI_gset_str_new_ex(), curve_select_random_exec(), edbm_select_random_exec(), edbm_sort_elements_exec(), gpu_node_graph_finalize_uniform_attrs(), blender::deg::ComponentNode::OperationIDKey::hash(), blender::deg::IDNode::ComponentIDKey::hash(), image_foreach_cache(), lattice_select_random_exec(), node_foreach_cache(), object_rand_verts_exec(), select_random_metaelems_exec(), seq_proxy_build_job(), sequencer_rebuild_proxy_exec(), strhash_pair_p(), TEST(), and wm_link_append_exec().
Definition at line 144 of file BLI_ghash_utils.c.
References BLI_hash_mm2(), and ptr.
Referenced by ensure_ed_screen_context_functions(), gpencil_layer_random_color_get(), GPU_vertformat_safe_attr_name(), lib_weak_key_hash(), make(), override_library_rna_path_mapping_ensure(), TEST(), and workbench_material_ubo_data().
Definition at line 74 of file BLI_ghash_utils.c.
Referenced by BKE_idtype_cache_key_hash(), BKE_sim_debug_data_hash(), gpu_node_graph_finalize_uniform_attrs(), blender::deg::ComponentNode::OperationIDKey::hash(), blender::deg::IDNode::ComponentIDKey::hash(), and uv_edge_hash().
Definition at line 51 of file BLI_ghash_utils.c.
References hash.
Definition at line 69 of file BLI_ghash_utils.c.
References Freestyle::a, and usdtokens::b().
Referenced by TEST().
Definition at line 64 of file BLI_ghash_utils.c.
References BLI_hash_mm2().
GSet* BLI_gset_int_new | ( | const char * | info | ) |
Definition at line 262 of file BLI_ghash_utils.c.
References BLI_gset_int_new_ex().
Referenced by BKE_fcurves_calc_keyed_frames_ex(), gpencil_select_same_material(), last_displayed_thumbnails_list_ensure(), sculpt_expand_geodesics_from_state_boundary(), sculpt_expand_modal(), SCULPT_geodesic_from_vertex(), and SCULPT_geodesic_from_vertex_and_symm().
Definition at line 258 of file BLI_ghash_utils.c.
References BLI_ghashutil_intcmp(), BLI_ghashutil_inthash_p(), and BLI_gset_new_ex().
Referenced by BLI_gset_int_new(), pose_ik_chain_init_face_sets(), pose_ik_chain_init_face_sets_fk(), and sculpt_boundary_indices_init().
GSet* BLI_gset_pair_new | ( | const char * | info | ) |
Definition at line 253 of file BLI_ghash_utils.c.
References BLI_gset_pair_new_ex().
Referenced by bm_edgering_pair_calc().
Definition at line 249 of file BLI_ghash_utils.c.
References BLI_ghashutil_paircmp(), BLI_ghashutil_pairhash(), and BLI_gset_new_ex().
Referenced by BLI_gset_pair_new().
GSet* BLI_gset_ptr_new | ( | const char * | info | ) |
Definition at line 235 of file BLI_ghash_utils.c.
References BLI_gset_ptr_new_ex().
Referenced by animdata_filter_remove_duplis(), animsys_evaluate_nla_domain(), BKE_cachefile_reader_open(), BKE_library_make_local(), BKE_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BM_mesh_intersect(), bmo_grid_fill_exec(), BMW_init(), bone_mouse_select_menu(), collection_flag_exec(), collection_instance_exec(), collection_isolate_exec(), collection_link_exec(), collection_view_layer_exec(), collection_visibility_exec(), collections_view_layer_poll(), do_render_compositor_scenes(), drw_task_graph_init(), join_tracks_exec(), knifetool_init(), menu_items_from_ui_create(), outliner_collection_delete(), outliner_delete_exec(), outliner_hide_exec(), pbvh_bmesh_create_nodes_fast_recursive(), pbvh_bmesh_node_finalize(), recalcData_pose(), scene_objects_iterator_begin(), screen_ctx_sel_actions_impl(), SEQ_fcurves_by_strip_get(), similar_edge_select_exec(), similar_face_select_exec(), similar_vert_select_exec(), skin_root_mark_exec(), special_aftertrans_update__pose(), subdiv_ccg_average_faces_boundaries_and_corners(), uv_rip_pairs_from_loop(), and uv_rip_single_from_loop().
Definition at line 231 of file BLI_ghash_utils.c.
References BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), and BLI_gset_new_ex().
Referenced by BLI_gset_ptr_new(), createTransObject(), ED_object_xform_array_m4(), ED_object_xform_skip_child_container_item_ensure_from_array(), loop_find_regions(), pbvh_bmesh_create_nodes_fast_recursive(), and pbvh_bmesh_node_split().
GSet* BLI_gset_str_new | ( | const char * | info | ) |
Definition at line 244 of file BLI_ghash_utils.c.
References BLI_gset_str_new_ex().
Referenced by ED_image_save_all_modified_info(), get_used_lightgroups(), IMB_thumb_locks_acquire(), and similar_vert_select_exec().
Definition at line 240 of file BLI_ghash_utils.c.
References BLI_ghashutil_strcmp(), BLI_ghashutil_strhash_p(), and BLI_gset_new_ex().
Referenced by BKE_main_id_repair_duplicate_names_listbase(), BLI_gset_str_new(), and make_structDNA().