|
Blender
V2.93
|
#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 235 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(), BKE_object_preview_geometry_set_add(), BM_mesh_intersect(), bm_uuidwalk_init(), 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 231 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(), gpencil_fill_modal(), gpencil_merge_layer_exec(), GPU_pbvh_bmesh_buffers_update(), make_duplis_font(), and objfnt_to_ftvfontdata().
| GHash* BLI_ghash_pair_new | ( | const char * | info | ) |
Definition at line 244 of file BLI_ghash_utils.c.
References BLI_ghash_pair_new_ex().
Definition at line 240 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 217 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_lib_exit(), cloth_sim_initialize_default_node_state(), drw_duplidata_load(), 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(), ED_transform_snap_object_context_create(), edbm_face_split_by_edges_exec(), EEVEE_materials_cache_init(), gpencil_analyze_strokes(), gpencil_interpolate_seq_exec(), 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(), make_object_duplilist_real(), menu_items_from_ui_create(), mesh_customdatacorrect_init_container_generic(), ntree_copy_data(), OVERLAY_armature_cache_init(), pbvh_bmesh_collapse_short_edges(), recalcData_gpencil_strokes(), sb_new_scratch(), scanfill_preprocess_self_isect(), snap_object_data_editmesh_get(), 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, |
| const unsigned int | nentries_reserve | ||
| ) |
Wrapper GHash Creation Functions
Definition at line 213 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(), and mesh_customdatacorrect_init_container_merge_group().
| GHash* BLI_ghash_str_new | ( | const char * | info | ) |
Definition at line 226 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_make(), BKE_view_layer_verify_aov(), ED_armature_join_objects_exec(), ED_gpencil_join_objects_exec(), gpencil_strokes_copypastebuf_colors_name_to_material_create(), gpu_material_library_init(), nlaeval_init(), postEditBoneDuplicate(), read_library_linked_ids(), RNA_init(), and text_autocomplete_build().
Definition at line 222 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 132 of file BLI_ghash_utils.c.
Referenced by BKE_idtype_cache_key_hash(), blender::fn::mf_network_optimization::compute_node_hash(), eevee_object_key_hash(), blender::deg::ComponentNode::OperationIDKey::hash(), and blender::deg::IDNode::ComponentIDKey::hash().
| bool BLI_ghashutil_intcmp | ( | const void * | a, |
| const void * | b | ||
| ) |
Definition at line 127 of file BLI_ghash_utils.c.
References Freestyle::a.
Referenced by BLI_ghash_int_new_ex(), BLI_gset_int_new_ex(), BLO_memfile_write_init(), keycmp(), and TEST().
| uint BLI_ghashutil_inthash_p | ( | const void * | ptr | ) |
Definition at line 101 of file BLI_ghash_utils.c.
References ptr.
Referenced by BLI_ghash_int_new_ex(), BLI_gset_int_new_ex(), and TEST().
| uint BLI_ghashutil_inthash_p_murmur | ( | const void * | ptr | ) |
Definition at line 115 of file BLI_ghash_utils.c.
References BLI_hash_mm2(), and ptr.
Referenced by TEST().
| uint BLI_ghashutil_inthash_p_simple | ( | const void * | ptr | ) |
Definition at line 122 of file BLI_ghash_utils.c.
References POINTER_AS_UINT, and ptr.
Referenced by BLO_memfile_write_init().
| GHashPair* BLI_ghashutil_pairalloc | ( | const void * | first, |
| const void * | second | ||
| ) |
Definition at line 179 of file BLI_ghash_utils.c.
References GHashPair::first, MEM_mallocN, and GHashPair::second.
Referenced by bm_edgering_pair_calc().
| bool BLI_ghashutil_paircmp | ( | const void * | a, |
| const void * | b | ||
| ) |
Definition at line 194 of file BLI_ghash_utils.c.
References A, Freestyle::a, and B.
Referenced by BLI_ghash_pair_new_ex(), and BLI_gset_pair_new_ex().
| void BLI_ghashutil_pairfree | ( | void * | ptr | ) |
Definition at line 202 of file BLI_ghash_utils.c.
| uint BLI_ghashutil_pairhash | ( | const void * | ptr | ) |
Definition at line 187 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().
| bool BLI_ghashutil_ptrcmp | ( | const void * | a, |
| const void * | b | ||
| ) |
Definition at line 61 of file BLI_ghash_utils.c.
References Freestyle::a.
Referenced by BKE_lib_override_library_resync(), 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(), library_foreach_ID_link(), select_more_less_seq__internal(), selected_items_init(), stats_update(), view_layer_bases_hash_create(), and wm_link_append_exec().
| uint BLI_ghashutil_ptrhash | ( | const void * | key | ) |
Callbacks for GHash (BLI_ghashutil_)
Definition at line 50 of file BLI_ghash_utils.c.
References y.
Referenced by BKE_idtype_cache_key_hash(), BKE_lib_override_library_resync(), 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(), dupliobject_hash(), EEVEE_motion_blur_data_init(), eevee_object_key_hash(), GPU_material_from_nodetree(), idkey_hash(), library_foreach_ID_link(), nlaevalchan_keyhash(), select_more_less_seq__internal(), selected_items_init(), stats_update(), tse_hash(), view_layer_bases_hash_create(), and wm_link_append_exec().
| bool BLI_ghashutil_strcmp | ( | const void * | a, |
| const void * | b | ||
| ) |
Definition at line 174 of file BLI_ghash_utils.c.
References Freestyle::a, 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(), override_library_rna_path_mapping_ensure(), seq_build_proxy(), 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 146 of file BLI_ghash_utils.c.
Referenced by ui_popup_string_hash().
| uint BLI_ghashutil_strhash_p | ( | const void * | ptr | ) |
Definition at line 157 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(), node_foreach_cache(), object_rand_verts_exec(), select_random_metaelems_exec(), seq_build_proxy(), seq_proxy_build_job(), sequencer_rebuild_proxy_exec(), strhash_pair_p(), TEST(), and wm_link_append_exec().
| uint BLI_ghashutil_strhash_p_murmur | ( | const void * | ptr | ) |
Definition at line 168 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(), make(), override_library_rna_path_mapping_ensure(), TEST(), and workbench_material_ubo_data().
Definition at line 89 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 66 of file BLI_ghash_utils.c.
References hash.
| bool BLI_ghashutil_uinthash_v4_cmp | ( | const void * | a, |
| const void * | b | ||
| ) |
Definition at line 84 of file BLI_ghash_utils.c.
References Freestyle::a.
Referenced by filelist_cache_init(), filelist_new(), and TEST().
Definition at line 79 of file BLI_ghash_utils.c.
References BLI_hash_mm2().
| GSet* BLI_gset_int_new | ( | const char * | info | ) |
Definition at line 286 of file BLI_ghash_utils.c.
References BLI_gset_int_new_ex().
Referenced by BKE_fcurves_calc_keyed_frames_ex(), code_generate_fragment(), count_active_texture_sampler(), sculpt_expand_geodesics_from_state_boundary(), sculpt_expand_modal(), SCULPT_geodesic_from_vertex(), and SCULPT_geodesic_from_vertex_and_symm().
Definition at line 282 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 277 of file BLI_ghash_utils.c.
References BLI_gset_pair_new_ex().
Referenced by bm_edgering_pair_calc().
Definition at line 273 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 259 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(), similar_edge_select_exec(), similar_face_select_exec(), similar_vert_select_exec(), skin_root_mark_exec(), special_aftertrans_update__pose(), uv_rip_pairs_from_loop(), and uv_rip_single_from_loop().
Definition at line 255 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_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 268 of file BLI_ghash_utils.c.
References BLI_gset_str_new_ex().
Referenced by ED_image_save_all_modified_info(), gpencil_select_same_material(), IMB_thumb_locks_acquire(), and similar_vert_select_exec().
Definition at line 264 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().