|
Blender V4.3
|
#include <limits.h>#include <stdarg.h>#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "BLI_math_base.h"#include "BLI_mempool.h"#include "BLI_sys_types.h"#include "BLI_utildefines.h"#include "BLI_ghash.h"#include "BLI_strict_flags.h"Go to the source code of this file.
Classes | |
| struct | Entry |
| struct | GHashEntry |
| struct | GHash |
Macros | |
| #define | GHASH_INTERNAL_API |
Functions | |
Internal Utility API | |
| BLI_INLINE void | ghash_entry_copy (GHash *gh_dst, Entry *dst, const GHash *gh_src, const Entry *src, GHashKeyCopyFP keycopyfp, GHashValCopyFP valcopyfp) |
| BLI_INLINE uint | ghash_keyhash (const GHash *gh, const void *key) |
| BLI_INLINE uint | ghash_entryhash (const GHash *gh, const Entry *e) |
| BLI_INLINE uint | ghash_bucket_index (const GHash *gh, const uint hash) |
| BLI_INLINE uint | ghash_find_next_bucket_index (const GHash *gh, uint curr_bucket) |
| static void | ghash_buckets_resize (GHash *gh, const uint nbuckets) |
| static void | ghash_buckets_expand (GHash *gh, const uint nentries, const bool user_defined) |
| static void | ghash_buckets_contract (GHash *gh, const uint nentries, const bool user_defined, const bool force_shrink) |
| BLI_INLINE void | ghash_buckets_reset (GHash *gh, const uint nentries) |
| BLI_INLINE Entry * | ghash_lookup_entry_ex (const GHash *gh, const void *key, const uint bucket_index) |
| BLI_INLINE Entry * | ghash_lookup_entry_prev_ex (GHash *gh, const void *key, Entry **r_e_prev, const uint bucket_index) |
| BLI_INLINE Entry * | ghash_lookup_entry (const GHash *gh, const void *key) |
| static GHash * | ghash_new (GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info, const uint nentries_reserve, const uint flag) |
| BLI_INLINE void | ghash_insert_ex (GHash *gh, void *key, void *val, const uint bucket_index) |
| BLI_INLINE void | ghash_insert_ex_keyonly_entry (GHash *gh, void *key, const uint bucket_index, Entry *e) |
| BLI_INLINE void | ghash_insert_ex_keyonly (GHash *gh, void *key, const uint bucket_index) |
| BLI_INLINE void | ghash_insert (GHash *gh, void *key, void *val) |
| BLI_INLINE bool | ghash_insert_safe (GHash *gh, void *key, void *val, const bool override, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) |
| BLI_INLINE bool | ghash_insert_safe_keyonly (GHash *gh, void *key, const bool override, GHashKeyFreeFP keyfreefp) |
| static Entry * | ghash_remove_ex (GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp, const uint bucket_index) |
| static Entry * | ghash_pop (GHash *gh, GHashIterState *state) |
| static void | ghash_free_cb (GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) |
| static GHash * | ghash_copy (const GHash *gh, GHashKeyCopyFP keycopyfp, GHashValCopyFP valcopyfp) |
GHash Public API | |
| GHash * | BLI_ghash_new_ex (GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info, const uint nentries_reserve) |
| GHash * | BLI_ghash_new (GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) |
| GHash * | BLI_ghash_copy (const GHash *gh, GHashKeyCopyFP keycopyfp, GHashValCopyFP valcopyfp) |
| void | BLI_ghash_reserve (GHash *gh, const uint nentries_reserve) |
| uint | BLI_ghash_len (const GHash *gh) |
| void | BLI_ghash_insert (GHash *gh, void *key, void *val) |
| bool | BLI_ghash_reinsert (GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) |
| void * | BLI_ghash_replace_key (GHash *gh, void *key) |
| void * | BLI_ghash_lookup (const GHash *gh, const void *key) |
| void * | BLI_ghash_lookup_default (const GHash *gh, const void *key, void *val_default) |
| void ** | BLI_ghash_lookup_p (GHash *gh, const void *key) |
| bool | BLI_ghash_ensure_p (GHash *gh, void *key, void ***r_val) |
| bool | BLI_ghash_ensure_p_ex (GHash *gh, const void *key, void ***r_key, void ***r_val) |
| bool | BLI_ghash_remove (GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) |
| void * | BLI_ghash_popkey (GHash *gh, const void *key, GHashKeyFreeFP keyfreefp) |
| bool | BLI_ghash_haskey (const GHash *gh, const void *key) |
| bool | BLI_ghash_pop (GHash *gh, GHashIterState *state, void **r_key, void **r_val) |
| void | BLI_ghash_clear_ex (GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp, const uint nentries_reserve) |
| void | BLI_ghash_clear (GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) |
| void | BLI_ghash_free (GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) |
| void | BLI_ghash_flag_set (GHash *gh, uint flag) |
| void | BLI_ghash_flag_clear (GHash *gh, uint flag) |
GHash Iterator API | |
| GHashIterator * | BLI_ghashIterator_new (GHash *gh) |
| void | BLI_ghashIterator_init (GHashIterator *ghi, GHash *gh) |
| void | BLI_ghashIterator_step (GHashIterator *ghi) |
| void | BLI_ghashIterator_free (GHashIterator *ghi) |
GSet Public API | |
| GSet * | BLI_gset_new_ex (GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info, const uint nentries_reserve) |
| GSet * | BLI_gset_new (GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) |
| GSet * | BLI_gset_copy (const GSet *gs, GHashKeyCopyFP keycopyfp) |
| uint | BLI_gset_len (const GSet *gs) |
| void | BLI_gset_insert (GSet *gs, void *key) |
| bool | BLI_gset_add (GSet *gs, void *key) |
| bool | BLI_gset_ensure_p_ex (GSet *gs, const void *key, void ***r_key) |
| bool | BLI_gset_reinsert (GSet *gs, void *key, GSetKeyFreeFP keyfreefp) |
| void * | BLI_gset_replace_key (GSet *gs, void *key) |
| bool | BLI_gset_remove (GSet *gs, const void *key, GSetKeyFreeFP keyfreefp) |
| bool | BLI_gset_haskey (const GSet *gs, const void *key) |
| bool | BLI_gset_pop (GSet *gs, GSetIterState *state, void **r_key) |
| void | BLI_gset_clear_ex (GSet *gs, GSetKeyFreeFP keyfreefp, const uint nentries_reserve) |
| void | BLI_gset_clear (GSet *gs, GSetKeyFreeFP keyfreefp) |
| void | BLI_gset_free (GSet *gs, GSetKeyFreeFP keyfreefp) |
| void | BLI_gset_flag_set (GSet *gs, uint flag) |
| void | BLI_gset_flag_clear (GSet *gs, uint flag) |
GSet Combined Key/Value Usage | |
| |
| void * | BLI_gset_lookup (const GSet *gs, const void *key) |
| void * | BLI_gset_pop_key (GSet *gs, const void *key) |
Debugging & Introspection | |
| int | BLI_ghash_buckets_len (const GHash *gh) |
| int | BLI_gset_buckets_len (const GSet *gs) |
| double | BLI_ghash_calc_quality_ex (const GHash *gh, double *r_load, double *r_variance, double *r_prop_empty_buckets, double *r_prop_overloaded_buckets, int *r_biggest_bucket) |
| double | BLI_gset_calc_quality_ex (const GSet *gs, double *r_load, double *r_variance, double *r_prop_empty_buckets, double *r_prop_overloaded_buckets, int *r_biggest_bucket) |
| double | BLI_ghash_calc_quality (const GHash *gh) |
| double | BLI_gset_calc_quality (const GSet *gs) |
Structs & Constants | |
| #define | GHASH_USE_MODULO_BUCKETS |
| #define | GHASH_MAX_SIZE 27 |
| #define | GHASH_LIMIT_GROW(_nbkt) (((_nbkt) * 3) / 4) |
| #define | GHASH_LIMIT_SHRINK(_nbkt) (((_nbkt) * 3) / 16) |
| #define | GHASH_ENTRY_SIZE(_is_gset) ((_is_gset) ? sizeof(GSetEntry) : sizeof(GHashEntry)) |
| typedef struct Entry | Entry |
| typedef struct GHashEntry | GHashEntry |
| typedef Entry | GSetEntry |
| static const uint | hashsizes [] |
| BLI_STATIC_ASSERT (ARRAY_SIZE(hashsizes)==GHASH_MAX_SIZE, "Invalid 'hashsizes' size") | |
A general (pointer -> pointer) chaining hash table for 'Abstract Data Types' (known as an ADT Hash Table).
Definition in file BLI_ghash.c.
| #define GHASH_ENTRY_SIZE | ( | _is_gset | ) | ((_is_gset) ? sizeof(GSetEntry) : sizeof(GHashEntry)) |
Definition at line 78 of file BLI_ghash.c.
Referenced by ghash_new().
| #define GHASH_INTERNAL_API |
Definition at line 24 of file BLI_ghash.c.
| #define GHASH_LIMIT_GROW | ( | _nbkt | ) | (((_nbkt) * 3) / 4) |
Definition at line 60 of file BLI_ghash.c.
Referenced by BLI_ghash_calc_quality_ex(), ghash_buckets_contract(), ghash_buckets_expand(), ghash_buckets_reset(), and ghash_copy().
| #define GHASH_LIMIT_SHRINK | ( | _nbkt | ) | (((_nbkt) * 3) / 16) |
Definition at line 61 of file BLI_ghash.c.
Referenced by ghash_buckets_contract(), ghash_buckets_expand(), and ghash_buckets_reset().
| #define GHASH_MAX_SIZE 27 |
Definition at line 45 of file BLI_ghash.c.
Referenced by ghash_buckets_expand().
| #define GHASH_USE_MODULO_BUCKETS |
Definition at line 33 of file BLI_ghash.c.
| typedef struct Entry Entry |
| typedef struct GHashEntry GHashEntry |
Definition at line 76 of file BLI_ghash.c.
Definition at line 1083 of file BLI_ghash.c.
References GHash::nbuckets.
Referenced by BLI_gset_buckets_len(), TEST(), TEST(), and TEST().
Definition at line 1194 of file BLI_ghash.c.
References BLI_ghash_calc_quality_ex(), and NULL.
| double BLI_ghash_calc_quality_ex | ( | const GHash * | gh, |
| double * | r_load, | ||
| double * | r_variance, | ||
| double * | r_prop_empty_buckets, | ||
| double * | r_prop_overloaded_buckets, | ||
| int * | r_biggest_bucket ) |
Definition at line 1092 of file BLI_ghash.c.
References GHash::buckets, count, double(), e, GHASH_LIMIT_GROW, max_ii(), GHash::nbuckets, GHash::nentries, and sum().
Referenced by BLI_ghash_calc_quality(), BLI_gset_calc_quality(), BLI_gset_calc_quality_ex(), and print_ghash_stats().
| void BLI_ghash_clear | ( | GHash * | gh, |
| GHashKeyFreeFP | keyfreefp, | ||
| GHashValFreeFP | valfreefp ) |
Wraps BLI_ghash_clear_ex with zero entries reserved.
Definition at line 855 of file BLI_ghash.c.
References BLI_ghash_clear_ex().
Referenced by BKE_lib_override_library_clear(), BKE_main_idmap_clear(), BKE_sim_debug_data_clear(), BLI_gset_clear(), BM_log_cleanup_entry(), bm_uidwalk_clear(), bm_uidwalk_facestep_begin(), bm_uidwalk_pass_add(), bmo_planar_faces_exec(), filelist_clear_ex(), filelist_clear_main_files(), mask_clipboard_free_ex(), multi_small_ghash_tests_one(), and blender::bke::node_instance_hash_clear().
| void BLI_ghash_clear_ex | ( | GHash * | gh, |
| GHashKeyFreeFP | keyfreefp, | ||
| GHashValFreeFP | valfreefp, | ||
| unsigned int | nentries_reserve ) |
Reset gh clearing all entries.
| keyfreefp | Optional callback to free the key. |
| valfreefp | Optional callback to free the value. |
| nentries_reserve | Optionally reserve the number of members that the hash will hold. |
Definition at line 842 of file BLI_ghash.c.
References BLI_mempool_clear_ex(), GHash::entrypool, ghash_buckets_reset(), and ghash_free_cb().
Referenced by BLI_ghash_clear(), BLI_gset_clear_ex(), collection_gobject_hash_ensure_fix(), and filelist_cache_clear().
| GHash * BLI_ghash_copy | ( | const GHash * | gh, |
| GHashKeyCopyFP | keycopyfp, | ||
| GHashValCopyFP | valcopyfp ) |
Copy given GHash. Keys and values are also copied if relevant callback is provided, else pointers remain the same.
Definition at line 691 of file BLI_ghash.c.
References ghash_copy().
Referenced by BKE_vfontdata_copy(), and TEST().
| bool BLI_ghash_ensure_p | ( | GHash * | gh, |
| void * | key, | ||
| void *** | r_val ) |
Ensure key is exists in gh.
This handles the common situation where the caller needs ensure a key is added to gh, constructing a new value in the case the key isn't found. Otherwise use the existing value.
Such situations typically incur multiple lookups, however this function avoids them by ensuring the key is added, returning a pointer to the value so it can be used or initialized by the caller.
Definition at line 752 of file BLI_ghash.c.
References BLI_mempool_alloc(), e, GHash::entrypool, ghash_bucket_index(), ghash_insert_ex_keyonly_entry(), ghash_keyhash(), ghash_lookup_entry_ex(), hash, and NULL.
Referenced by BKE_icon_set(), BKE_main_idmap_create(), BKE_main_idmap_insert_id(), BKE_main_relations_create(), bke_view_layer_verify_aov_cb(), bm_face_region_pivot_edge_find(), BM_log_vert_before_modified(), bm_uidwalk_facestep_begin(), bm_uidwalk_pass_add(), bmo_planar_faces_exec(), ccd_build_deflector_hash_single(), collection_gobject_hash_create(), collection_gobject_hash_ensure_fix(), collection_gobject_hash_update_object(), collection_object_add(), blender::ed::object::data_xform_container_item_ensure(), drw_duplidata_load(), drw_register_shader_vlattrs(), edge_isect_ls_ensure(), ghash_insert_face_edge_link(), ghash_insert_link(), layer_collection_objects_sync(), lib_override_group_tag_data_object_to_collection_init_collection_process(), lib_override_resync_tagging_finalize(), main_relations_create_idlink_cb(), blender::ed::object::make_object_duplilist_real(), mesh_customdatacorrect_init_vert(), modify_mesh(), nlaevalchan_verify(), blender::ed::object::object_xform_skip_child_container_item_ensure(), and view_layer_bases_hash_create().
| bool BLI_ghash_ensure_p_ex | ( | GHash * | gh, |
| const void * | key, | ||
| void *** | r_key, | ||
| void *** | r_val ) |
A version of BLI_ghash_ensure_p that allows caller to re-assign the key. Typically used when the key is to be duplicated.
Definition at line 768 of file BLI_ghash.c.
References BLI_mempool_alloc(), BMVert::e, e, GHash::entrypool, ghash_bucket_index(), ghash_insert_ex_keyonly_entry(), ghash_keyhash(), ghash_lookup_entry_ex(), hash, and NULL.
Referenced by BKE_previewimg_cached_ensure(), drw_uniform_attrs_pool_ensure(), nlaevalchan_verify_key(), and scene_get_depsgraph_p().
Sets a GHash flag.
Definition at line 872 of file BLI_ghash.c.
References flag, and GHash::flag.
Referenced by BM_mesh_bevel(), TEST(), and TEST().
| void BLI_ghash_free | ( | GHash * | gh, |
| GHashKeyFreeFP | keyfreefp, | ||
| GHashValFreeFP | valfreefp ) |
Frees the GHash and its members.
| gh | The GHash to free. |
| keyfreefp | Optional callback to free the key. |
| valfreefp | Optional callback to free the value. |
Definition at line 860 of file BLI_ghash.c.
References BLI_assert, BLI_mempool_destroy(), BLI_mempool_len(), GHash::buckets, GHash::entrypool, ghash_free_cb(), MEM_freeN(), and GHash::nentries.
Referenced by armature_dissolve_selected_exec(), BKE_addon_pref_type_free(), BKE_area_region_free(), BKE_armature_bone_hash_free(), BKE_collection_delete(), BKE_curve_editNurb_keyIndex_free(), BKE_fcurve_pathcache_destroy(), BKE_icons_free(), BKE_keyconfig_pref_type_free(), BKE_lib_override_library_free(), BKE_main_collection_sync_remap(), BKE_main_idmap_destroy(), BKE_main_relations_free(), BKE_nlastrip_validate_name(), BKE_object_defgroup_validmap_get(), BKE_object_material_remap_calc(), BKE_pose_channels_hash_free(), BKE_preview_images_free(), BKE_scene_free_depsgraph_hash(), BKE_scene_undo_depsgraphs_restore(), BKE_sim_debug_data_free(), BKE_vfont_free_data(), BKE_view_layer_free_object_content(), BKE_view_layer_verify_aov(), BLI_args_destroy(), BLI_array_store_is_valid(), BLI_gset_free(), blo_cache_storage_end(), blo_filedata_free(), bm_edgering_pair_calc(), bm_edgering_pair_store_free(), bm_face_region_pivot_edge_find(), bm_log_entry_free(), BM_log_free(), BM_log_mesh_elems_reorder(), BM_mesh_bevel(), BM_mesh_edgesplit(), BM_mesh_intersect(), BM_mesh_remap(), bm_uidwalk_free(), bmo_extrude_discrete_faces_exec(), bmo_extrude_vert_indiv_exec(), bmo_inset_region_exec(), bmo_mesh_copy(), bmo_op_slots_free(), bmo_planar_faces_exec(), bmo_triangle_fill_exec(), bmo_weld_verts_exec(), BPY_rna_exit(), LibOverrideGroupTagData::clear(), collection_free_data(), createTransObject(), blender::ed::object::data_xform_container_destroy(), discard_stabilization_working_context(), DNA_alias_maps(), DNA_sdna_alias_data_ensure(), DNA_sdna_free(), drw_duplidata_free(), DRW_uniform_attrs_pool_free(), DRW_viewport_data_free(), ED_armature_join_objects_exec(), ED_gpencil_strokes_copybuf_free(), edbm_face_split_by_edges_exec(), filelist_cache_free(), filelist_free(), free_context_function_ghash(), free_scratch(), fsmenu_xdg_user_dirs_free(), IMB_moviecache_free(), int4_ghash_tests(), int_ghash_tests(), knife_add_cut(), knifetool_exit_ex(), lib_override_library_main_resync_on_library_indirect_level(), lib_override_library_resync(), make_duplis_font(), blender::ed::object::make_object_duplilist_real(), make_structDNA(), mask_clipboard_free_ex(), mesh_customdatacorrect_free(), mesh_get_x_mirror_faces(), mesh_undostep_reference_elems_from_objects(), modify_mesh(), multi_small_ghash_tests(), nlaeval_free(), blender::bke::node_instance_hash_free(), blender::bke::node_system_exit(), blender::ed::object::object_xform_skip_child_container_destroy(), OVERLAY_armature_cache_finish(), palette_extract_img_exec(), blender::bke::pbvh::pbvh_bmesh_collapse_short_edges(), postEditBoneDuplicate(), randint_ghash_tests(), recalcData_gpencil_strokes(), RNA_exit(), RNA_free(), scanfill_preprocess_self_isect(), seq_cache_destruct(), state_delete(), stitch_init(), str_ghash_tests(), TEST(), TEST(), TEST(), TEST(), TEST(), text_autocomplete_free(), tracking_copy_context_delete(), tracks_map_free(), UI_blocklist_free(), uv_sculpt_stroke_init(), wm_gizmogrouptype_free(), wm_gizmomap_select_all_intern(), wm_gizmotype_free(), WM_menutype_free(), WM_paneltype_clear(), WM_uilisttype_free(), Freestyle::BlenderStrokeRenderer::~BlenderStrokeRenderer(), and blender::geometry::ParamHandle::~ParamHandle().
| bool BLI_ghash_haskey | ( | const GHash * | gh, |
| const void * | key ) |
Definition at line 819 of file BLI_ghash.c.
References ghash_lookup_entry(), and NULL.
Referenced by BKE_collection_object_replace(), blo_cache_storage_entry_register(), bm_edgering_pair_interpolate(), bm_face_region_pivot_edge_find(), bm_log_face_from_id(), bm_log_face_id_get(), BM_log_face_removed(), BM_log_original_mask(), BM_log_original_vert_co(), BM_log_original_vert_data(), BM_log_original_vert_no(), bm_log_vert_from_id(), bm_log_vert_id_get(), BM_log_vert_removed(), bm_uidwalk_facestep_begin(), bm_uidwalk_pass_add(), bm_vert_is_uid_connect(), ED_armature_bone_rename(), ghash_insert_ex(), ghash_insert_ex_keyonly(), ghash_insert_ex_keyonly_entry(), lib_override_library_main_resync_on_library_indirect_level(), lib_override_library_resync(), modify_mesh(), nla_editbone_name_check(), blender::bke::node_instance_hash_haskey(), palette_extract_img_exec(), recalcData_gpencil_strokes(), seq_cache_put_ex(), seq_cache_recycle_linked(), and str_ghash_tests().
| void BLI_ghash_insert | ( | GHash * | gh, |
| void * | key, | ||
| void * | val ) |
Insert a key/value pair into the gh.
Definition at line 707 of file BLI_ghash.c.
References ghash_insert().
Referenced by _bmo_slot_copy(), add_hit_to_facehits(), armature_bone_from_name_insert_recursive(), armature_dissolve_selected_exec(), attach_stabilization_baseline_data(), bevel_vert_construct(), BKE_addon_pref_type_add(), BKE_collection_object_replace(), BKE_fcurve_pathcache_create(), BKE_icon_delete_unmanaged(), BKE_keyconfig_pref_type_add(), BKE_lib_override_library_property_get(), BKE_lib_override_library_property_rna_path_change(), BKE_library_make_local(), BKE_main_idmap_insert_id(), BKE_main_idmap_lookup_name(), BKE_mask_clipboard_copy_from_layer(), BKE_nlastrip_validate_name(), BKE_object_defgroup_validmap_get(), BKE_pose_channel_ensure(), BKE_pose_channels_hash_ensure(), BKE_previewimg_cached_thumbnail_read(), BKE_scene_undo_depsgraphs_extract(), BKE_vfontdata_char_from_freetypefont(), blo_cache_storage_entry_register(), bm_edgering_pair_calc(), bm_edgering_pair_store_create(), bm_isect_edge_tri(), bm_log_compress_ids_to_indices(), BM_log_face_added(), BM_log_face_modified(), BM_log_face_removed(), BM_log_vert_added(), BM_log_vert_removed(), BM_mesh_edgesplit(), BM_mesh_intersect_edges(), BM_mesh_remap(), BM_select_history_map_create(), bm_uidwalk_init_from_edge(), bm_uidwalk_pass_add(), bm_uidwalk_rehash_facelinks(), bmo_edge_copy(), BMO_slot_map_insert(), bmo_triangle_fill_exec(), bmo_vert_copy(), bmo_weld_verts_exec(), createTransObject(), custom_bone_instance_shgroup(), debug_data_insert(), DNA_alias_maps(), DNA_sdna_alias_data_ensure_structs_map(), DNA_sdna_patch_struct(), ED_armature_bone_rename(), ED_armature_join_objects_exec(), ED_curve_keyindex_hash_duplicate(), filelist_entry_select_set(), filelist_file_cache_block_create(), filelist_file_ex(), find_family_object(), fsmenu_xdg_user_dirs_parse(), get_bm_knife_edge(), get_bm_knife_vert(), icon_create(), init_editNurb_keyIndex(), init_structDNA(), int4_ghash_tests(), int_ghash_tests(), internalAdd(), keyIndex_swap(), keyIndex_updateCV(), knife_get_face_kedges(), lib_override_library_resync(), blender::ed::object::make_object_duplilist_real(), mesh_customdatacorrect_init_vert(), mesh_get_x_mirror_faces(), mesh_undostep_reference_elems_from_objects(), modify_mesh(), multi_small_ghash_tests_one(), blender::bke::node_instance_hash_insert(), blender::bke::node_register_alias(), blender::bke::node_register_socket_type(), blender::bke::node_register_type(), blender::bke::node_tree_type_add(), override_library_rna_path_mapping_ensure(), palette_extract_img_exec(), blender::bke::pbvh::pbvh_bmesh_collapse_edge(), postEditBoneDuplicate(), randint_ghash_tests(), read_file_bhead_idname_map_create(), recalcData_gpencil_strokes(), record_face_kind(), register_context_function(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), rna_brna_structs_add(), RNA_def_property(), RNA_def_struct_identifier(), RNA_init(), seq_cache_put_ex(), set_lowest_face_tri(), stitch_init(), str_ghash_tests(), TEST(), TEST(), TEST(), TEST(), TEST(), text_autocomplete_build(), tracking_plane_tracks_copy(), tracking_tracks_copy(), tracks_map_insert(), blender::geometry::uv_prepare_pin_index(), uv_sculpt_stroke_init(), wm_gizmogrouptype_append__end(), WM_gizmomap_gizmo_hash_new(), wm_gizmotype_append__end(), WM_menutype_add(), WM_paneltype_add(), and WM_uilisttype_add().
Definition at line 702 of file BLI_ghash.c.
References GHash::nentries.
Referenced by BKE_object_defgroup_validmap_get(), BKE_palette_from_hash(), BLI_array_store_is_valid(), BM_log_all_added(), BM_log_print_entry(), BM_mesh_intersect(), bm_mesh_region_match_pair(), bm_uidwalk_facestep_begin(), bm_uidwalk_pass_add(), bm_uidwalk_rehash(), BMO_slot_map_len(), bmo_triangle_fill_exec(), BPY_rna_exit(), bpy_slot_to_py(), collection_gobject_hash_ensure_fix(), ED_curve_keyindex_hash_duplicate(), IMB_moviecache_get_cache_segments(), int_ghash_tests(), mesh_undostep_reference_elems_from_objects(), modify_mesh(), blender::bke::node_instance_hash_size(), print_ghash_stats(), SEQ_cache_iterate(), stitch_init(), TEST(), TEST(), TEST(), TEST(), TEST(), uv_sculpt_stroke_init(), and wm_gizmomap_select_all_intern().
| void * BLI_ghash_lookup | ( | const GHash * | gh, |
| const void * | key ) |
Lookup the value of key in gh.
| key | The key to lookup. |
Definition at line 731 of file BLI_ghash.c.
References BLI_assert, e, GHash::flag, ghash_lookup_entry(), and NULL.
Referenced by access_stabilization_baseline_data(), add_hit_to_facehits(), BKE_addon_pref_type_find(), BKE_armature_find_bone_name(), BKE_collection_has_object(), BKE_fcurve_pathcache_find(), BKE_fcurve_pathcache_find_array(), BKE_keyconfig_pref_type_find(), BKE_lib_override_library_property_find(), BKE_library_main_rebuild_hierarchy(), BKE_main_idmap_lookup_name(), BKE_main_idmap_lookup_uid(), BKE_mask_clipboard_copy_from_layer(), BKE_mask_clipboard_paste_to_layer(), BKE_object_defgroup_validmap_get(), BKE_pose_channel_find_name(), BKE_pose_channels_is_valid(), BKE_previewimg_cached_get(), BKE_scene_get_depsgraph(), BKE_view_layer_base_find(), BKE_view_layer_verify_aov(), blo_cache_storage_entry_clear_in_old(), blo_cache_storage_entry_restore_in_new(), bm_edgering_pair_calc(), bm_edgering_pair_interpolate(), bm_face_region_pivot_edge_find(), bm_face_region_pivot_edge_use_best(), bm_face_region_vert_pass_id(), bm_isect_edge_tri(), bm_log_face_from_id(), bm_log_face_id_get(), BM_log_face_removed(), BM_log_find_original_vert_co(), BM_log_find_original_vert_mask(), BM_log_mesh_elems_reorder(), BM_log_original_mask(), BM_log_original_vert_co(), BM_log_original_vert_data(), BM_log_original_vert_no(), BM_log_vert_before_modified(), bm_log_vert_from_id(), bm_log_vert_id_get(), BM_log_vert_removed(), BM_mesh_edgesplit(), BM_mesh_intersect_edges(), BM_mesh_remap(), BM_select_history_merge_from_targetmap(), bmo_edge_copy(), bmo_extrude_discrete_faces_exec(), bmo_extrude_vert_indiv_exec(), bmo_face_copy(), bmo_triangle_fill_exec(), calculate_struct_sizes(), ccd_update_deflector_hash_single(), collection_gobject_assert_internal_consistency(), createTransObject(), custom_bone_instance_shgroup(), debug_data_insert(), dna_sdna_alias_from_static_elem_full(), DRW_uniform_attrs_pool_find_ubo(), ed_screen_context(), filelist_cache_file_lookup(), filelist_entry_is_selected(), filelist_entry_select_get(), find_bevvert(), find_bhead_from_code_name(), find_bhead_from_idname(), find_vfont_char(), blender::ed::outliner::foreach_natural_hierarchy_child(), fsmenu_xdg_insert_entry(), get_bm_knife_edge(), get_bm_knife_vert(), get_face_kind(), get_lowest_face_tri(), get_next_free_id(), getCVKeyIndex(), icon_ghash_lookup(), IMB_moviecache_get(), IMB_moviecache_has_frame(), int4_ghash_tests(), int_ghash_tests(), knife_get_face_kedges(), lib_override_hierarchy_dependencies_recursive_tag(), lib_override_hierarchy_dependencies_recursive_tag_from(), lib_override_library_main_resync_on_library_indirect_level(), lib_override_library_remap(), lib_override_library_resync(), lib_override_linked_group_tag(), lib_override_linked_group_tag_recursive(), lib_override_overrides_group_tag_recursive(), lib_override_resync_tagging_finalize(), lib_override_resync_tagging_finalize_recurse(), lib_override_resync_tagging_finalize_recursive_check_from(), lib_override_root_find(), lib_override_root_hierarchy_set(), lib_query_unused_ids_tag(), lib_query_unused_ids_tag_recurse(), library_foreach_ID_link(), library_make_local_copying_check(), lookUp(), blender::ed::object::make_object_duplilist_real(), mesh_customdatacorrect_apply_vert(), mesh_get_x_mirror_faces(), mesh_vert_orig_co_get(), modify_mesh(), multi_small_ghash_tests_one(), blender::bke::node_instance_hash_lookup(), blender::bke::node_socket_type_find(), blender::bke::node_tree_type_find(), blender::bke::node_type_find(), blender::bke::node_type_find_alias(), pchan_duplicate_map(), randint_ghash_tests(), rebuild_hierarchy_best_parent_find(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), RNA_def_struct(), RNA_def_struct_nested(), RNA_struct_find(), scanfill_preprocess_self_isect(), seq_cache_get_ex(), set_lowest_face_tri(), stitch_init(), stitch_uv_edge_generate_linked_edges(), str_ghash_tests(), TEST(), TEST(), text_autocomplete_build(), tracking_object_copy(), tracking_plane_tracks_copy(), tracks_map_merge(), UI_block_region_set(), UI_blocklist_free_inactive(), uv_edge_get(), blender::geometry::uv_find_pin_index(), blender::geometry::uv_prepare_pin_index(), uv_sculpt_stroke_init(), version_member_static_from_alias(), version_struct_alias_from_static(), version_struct_static_from_alias(), view_layer_objects_base_cache_validate(), WM_gizmo_group_type_free(), WM_gizmogrouptype_find(), WM_gizmotype_find(), WM_gizmotype_remove(), WM_menutype_find(), WM_paneltype_find(), and WM_uilisttype_find().
| void * BLI_ghash_lookup_default | ( | const GHash * | gh, |
| const void * | key, | ||
| void * | val_default ) |
A version of BLI_ghash_lookup which accepts a fallback argument.
Definition at line 738 of file BLI_ghash.c.
References BLI_assert, e, GHash::flag, and ghash_lookup_entry().
Referenced by DNA_alias_maps(), DNA_sdna_alias_data_ensure(), and DNA_struct_find_index_wrapper().
| void ** BLI_ghash_lookup_p | ( | GHash * | gh, |
| const void * | key ) |
Lookup a pointer to the value of key in gh.
| key | The key to lookup. |
Definition at line 745 of file BLI_ghash.c.
References BLI_assert, e, GHash::flag, ghash_lookup_entry(), and NULL.
Referenced by armature_dissolve_selected_exec(), BKE_object_defgroup_validmap_get(), BKE_object_material_remap_calc(), BKE_previewimg_cached_thumbnail_read(), BKE_scene_undo_depsgraphs_extract(), BKE_scene_undo_depsgraphs_restore(), bm_face_region_pivot_edge_find(), BM_mesh_intersect_edges(), bm_uidwalk_face_lookup(), bm_uidwalk_rehash_facelinks(), bm_uidwalk_vert_lookup(), blender::bke::pbvh::bm_vert_hash_lookup_chain(), dna_struct_find_index_ex_impl(), filelist_entry_select_set(), find_family_object(), lib_override_library_id_hierarchy_recursive_reset(), and scene_get_depsgraph_p().
| GHash * BLI_ghash_new | ( | GHashHashFP | hashfp, |
| GHashCmpFP | cmpfp, | ||
| const char * | info ) |
Wraps BLI_ghash_new_ex with zero entries reserved.
Definition at line 686 of file BLI_ghash.c.
References BLI_ghash_new_ex().
Referenced by BKE_main_idmap_lookup_name(), BKE_main_relations_create(), BKE_scene_allocate_depsgraph_hash(), BKE_scene_undo_depsgraphs_extract(), BKE_sim_debug_data_set_enabled(), BLI_args_create(), blo_cache_storage_init(), bm_log_entry_create(), BM_mesh_intersect(), drw_duplidata_load(), DRW_viewport_data_create(), ensure_ed_screen_context_functions(), filelist_new(), GPU_uniform_attr_list_hash_new(), IMB_moviecache_create(), lib_override_group_tag_data_object_to_collection_init(), lib_override_library_resync(), blender::ed::object::make_object_duplilist_real(), nlaeval_init(), blender::bke::node_instance_hash_new(), override_library_rna_path_mapping_ensure(), seq_cache_create(), stitch_init(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), uv_sculpt_stroke_init(), and view_layer_bases_hash_create().
| GHash * BLI_ghash_new_ex | ( | GHashHashFP | hashfp, |
| GHashCmpFP | cmpfp, | ||
| const char * | info, | ||
| unsigned int | nentries_reserve ) |
Creates a new, empty GHash.
| hashfp | Hash callback. |
| cmpfp | Comparison callback. |
| info | Identifier string for the GHash. |
| nentries_reserve | Optionally reserve the number of members that the hash will hold. Use this to avoid resizing buckets if the size is known or can be closely approximated. |
Definition at line 678 of file BLI_ghash.c.
References ghash_new().
Referenced by BLI_ghash_int_new_ex(), BLI_ghash_new(), BLI_ghash_pair_new_ex(), BLI_ghash_ptr_new_ex(), BLI_ghash_str_new_ex(), BM_log_create(), DNA_alias_maps(), filelist_cache_init(), ghash_bmelem_new_ex(), and mesh_get_x_mirror_faces().
| bool BLI_ghash_pop | ( | GHash * | gh, |
| GHashIterState * | state, | ||
| void ** | r_key, | ||
| void ** | r_val ) |
Remove a random entry from gh, returning true if a key/value pair could be removed, false otherwise.
| r_key | The removed key. |
| r_val | The removed value. |
| state | Used for efficient removal. |
Definition at line 824 of file BLI_ghash.c.
References BLI_assert, BLI_mempool_free(), BMVert::e, e, GHash::entrypool, GHash::flag, ghash_pop(), NULL, and state.
Referenced by int_ghash_tests(), and TEST().
| void * BLI_ghash_popkey | ( | GHash * | gh, |
| const void * | key, | ||
| GHashKeyFreeFP | keyfreefp ) |
Remove key from gh, returning the value or NULL if the key wasn't found.
| key | The key to remove. |
| keyfreefp | Optional callback to free the key. |
Definition at line 802 of file BLI_ghash.c.
References BLI_assert, BLI_mempool_free(), e, GHash::entrypool, GHash::flag, ghash_bucket_index(), ghash_keyhash(), ghash_remove_ex(), hash, and NULL.
Referenced by BKE_collection_object_replace(), BKE_icon_delete(), BKE_icon_delete_unmanaged(), BKE_lib_override_library_property_rna_path_change(), BKE_lib_override_library_property_search_and_delete(), BKE_previewimg_cached_release(), collection_gobject_hash_update_object(), collection_object_remove(), filelist_file_cache_block_create(), filelist_file_ex(), mesh_undostep_reference_elems_from_objects(), blender::bke::node_instance_hash_pop(), popCVKeyIndex(), TEST(), and TEST().
| bool BLI_ghash_reinsert | ( | GHash * | gh, |
| void * | key, | ||
| void * | val, | ||
| GHashKeyFreeFP | keyfreefp, | ||
| GHashValFreeFP | valfreefp ) |
Inserts a new value to a key that may already be in ghash.
Avoids BLI_ghash_remove, BLI_ghash_insert calls (double lookups)
Definition at line 712 of file BLI_ghash.c.
References ghash_insert_safe().
Referenced by BKE_object_material_remap_calc(), bm_log_face_id_set(), bm_log_vert_id_set(), do_moviecache_put(), tracks_map_merge(), and UI_block_region_set().
| bool BLI_ghash_remove | ( | GHash * | gh, |
| const void * | key, | ||
| GHashKeyFreeFP | keyfreefp, | ||
| GHashValFreeFP | valfreefp ) |
Remove key from gh, or return false if the key wasn't found.
| key | The key to remove. |
| keyfreefp | Optional callback to free the key. |
| valfreefp | Optional callback to free the value. |
Definition at line 787 of file BLI_ghash.c.
References BLI_mempool_free(), e, GHash::entrypool, ghash_bucket_index(), ghash_keyhash(), ghash_remove_ex(), and hash.
Referenced by BKE_addon_pref_type_remove(), BKE_curve_editNurb_keyIndex_delCV(), BKE_icon_id_delete(), BKE_icons_deferred_free(), BKE_keyconfig_pref_type_remove(), BKE_layer_collection_sync(), BKE_main_idmap_remove_id(), BKE_pose_channels_remove(), BKE_scene_free_view_layer_depsgraph(), BKE_sim_debug_data_clear_category(), BKE_sim_debug_data_remove_element(), BLI_gset_remove(), BM_log_face_removed(), BM_log_vert_removed(), check_unused_keys(), DNA_sdna_patch_struct(), draw_prune_vlattrs(), DRW_uniform_attrs_pool_clear_all(), ED_armature_bone_rename(), filelist_entry_select_set(), filelist_file_cache_block_release(), filelist_file_ex(), IMB_moviecache_cleanup(), IMB_moviecache_remove(), lib_override_library_property_delete(), menu_items_from_ui_create(), blender::bke::node_instance_hash_remove(), blender::bke::node_tree_type_free_link(), blender::bke::node_unregister_socket_type(), blender::bke::node_unregister_type(), RNA_def_struct_identifier(), SEQ_cache_cleanup(), seq_cache_cleanup_sequence(), seq_cache_free_temp_cache(), seq_cache_recycle_linked(), UI_blocklist_free_inactive(), WM_gizmo_group_type_free_ptr(), WM_gizmotype_remove_ptr(), WM_menutype_freelink(), WM_paneltype_remove(), and WM_uilisttype_remove_ptr().
| void * BLI_ghash_replace_key | ( | GHash * | gh, |
| void * | key ) |
Replaces the key of an item in the gh.
Use when a key is re-allocated or its memory location is changed.
Definition at line 718 of file BLI_ghash.c.
References BMVert::e, e, ghash_bucket_index(), ghash_keyhash(), ghash_lookup_entry_ex(), hash, and NULL.
Referenced by BLI_gset_replace_key().
Reserve given amount of entries (resize gh accordingly if needed).
Definition at line 696 of file BLI_ghash.c.
References ghash_buckets_contract(), and ghash_buckets_expand().
Referenced by BM_log_all_added(), int4_ghash_tests(), int_ghash_tests(), multi_small_ghash_tests_one(), randint_ghash_tests(), and str_ghash_tests().
| void BLI_ghashIterator_free | ( | GHashIterator * | ghi | ) |
Free a GHashIterator.
| ghi | The iterator to free. |
Definition at line 925 of file BLI_ghash.c.
References MEM_freeN().
Referenced by BKE_main_relations_tag_set(), BLI_gsetIterator_free(), GPUCodegen::generate_library(), IMB_moviecacheIter_free(), lib_override_library_main_resync_on_library_indirect_level(), blender::bke::node_instance_hash_iterator_free(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), and sb_detect_vertex_collisionCached().
| void BLI_ghashIterator_init | ( | GHashIterator * | ghi, |
| GHash * | gh ) |
Init an already allocated GHashIterator. The hash table must not be mutated while the iterator is in use, and the iterator will step exactly #BLI_ghash_len(gh) times before becoming done.
| ghi | The GHashIterator to initialize. |
| gh | The GHash to iterate over. |
Definition at line 895 of file BLI_ghash.c.
References GHash::buckets, GHashIterator::curBucket, GHashIterator::curEntry, GHashIterator::gh, GHash::nbuckets, GHash::nentries, NULL, UINT_MAX, and UNLIKELY.
Referenced by BKE_sim_debug_data_clear_category(), BLI_ghashIterator_new(), BLI_gsetIterator_init(), BMO_iter_new(), check_unused_keys(), IMB_moviecache_cleanup(), blender::bke::node_instance_hash_iterator_init(), SEQ_cache_cleanup(), seq_cache_cleanup_sequence(), seq_cache_free_temp_cache(), seq_cache_get_item_for_removal(), SEQ_cache_iterate(), WM_gizmogrouptype_iter(), WM_gizmotype_iter(), and WM_menutype_iter().
| GHashIterator * BLI_ghashIterator_new | ( | GHash * | gh | ) |
Create a new GHashIterator. The hash table must not be mutated while the iterator is in use, and the iterator will step exactly #BLI_ghash_len(gh) times before becoming done.
| gh | The GHash to iterate over. |
Definition at line 888 of file BLI_ghash.c.
References BLI_ghashIterator_init(), and MEM_mallocN.
Referenced by BKE_main_relations_tag_set(), BLI_gsetIterator_new(), GPUCodegen::generate_library(), IMB_moviecacheIter_new(), lib_override_library_main_resync_on_library_indirect_level(), blender::bke::node_instance_hash_iterator_new(), blender::bke::node_socket_type_get_iterator(), blender::bke::node_tree_type_get_iterator(), blender::bke::node_type_get_iterator(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), and sb_detect_vertex_collisionCached().
| void BLI_ghashIterator_step | ( | GHashIterator * | ghi | ) |
Steps the iterator to the next index.
| ghi | The iterator. |
Definition at line 911 of file BLI_ghash.c.
References GHash::buckets, GHashIterator::curBucket, GHashIterator::curEntry, GHashIterator::gh, GHash::nbuckets, and Entry::next.
Referenced by BKE_main_relations_tag_set(), BKE_sim_debug_data_clear_category(), BLI_gsetIterator_step(), BMO_iter_step(), check_unused_keys(), GPUCodegen::generate_library(), IMB_moviecache_cleanup(), IMB_moviecacheIter_step(), lib_override_library_main_resync_on_library_indirect_level(), menu_items_from_ui_create(), blender::bke::node_instance_hash_iterator_step(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), SEQ_cache_cleanup(), seq_cache_cleanup_sequence(), seq_cache_free_temp_cache(), seq_cache_get_item_for_removal(), and SEQ_cache_iterate().
| bool BLI_gset_add | ( | GSet * | gs, |
| void * | key ) |
A version of BLI_gset_insert which checks first if the key is in the set.
Definition at line 966 of file BLI_ghash.c.
References ghash_insert_safe_keyonly(), and NULL.
Referenced by blender::ed::outliner::add_selected_item(), animdata_filter_remove_duplis(), BKE_fcurves_calc_keyed_frames_ex(), BKE_lib_query_foreachid_process(), BKE_library_foreach_ID_embedded(), BKE_library_make_local(), BKE_main_gset_create(), BKE_main_id_repair_duplicate_names_listbase(), BLO_blendhandle_get_linkable_groups(), bm_isect_tri_tri(), BM_mesh_intersect(), bmw_FaceLoopWalker_step(), blender::ed::outliner::collection_collect_data_to_edit(), createTransObject(), drw_batch_cache_generate_requested_delayed(), get_used_lightgroups(), IMB_thumb_path_lock(), knife_make_face_cuts(), blender::ed::outliner::layer_collection_collect_data_to_edit(), library_foreach_ID_link(), library_make_local_copying_check(), loop_find_region(), blender::ed::object::make_override_library_exec(), make_structDNA(), nla_eval_domain_action(), blender::ed::object::object_xform_array_m4(), blender::ed::outliner::outliner_collect_objects_to_delete(), blender::ed::outliner::outliner_hide_collect_data_to_edit(), py_bvhtree_overlap(), screen_ctx_sel_actions_impl(), seam_connected_recursive(), select_more_less_seq__internal(), SEQ_fcurves_by_strip_get(), similar_edge_select_exec(), similar_face_select_exec(), similar_vert_select_exec(), blender::ed::object::skin_root_clear(), blender::ed::object::skin_root_mark_exec(), stats_object(), uv_rip_pairs_add(), uv_rip_single_from_loop(), uv_select_overlap(), wm_msg_rna_update_by_id(), and blender::ed::object::xform_skip_child_container_item_ensure_from_array().
Definition at line 1087 of file BLI_ghash.c.
References BLI_ghash_buckets_len().
Definition at line 1198 of file BLI_ghash.c.
References BLI_ghash_calc_quality_ex(), and NULL.
| double BLI_gset_calc_quality_ex | ( | const GSet * | gs, |
| double * | r_load, | ||
| double * | r_variance, | ||
| double * | r_prop_empty_buckets, | ||
| double * | r_prop_overloaded_buckets, | ||
| int * | r_biggest_bucket ) |
Definition at line 1179 of file BLI_ghash.c.
References BLI_ghash_calc_quality_ex().
| void BLI_gset_clear | ( | GSet * | gs, |
| GSetKeyFreeFP | keyfreefp ) |
Definition at line 1029 of file BLI_ghash.c.
References BLI_ghash_clear(), and NULL.
Referenced by BKE_collection_validate(), BKE_main_idmap_clear(), bm_uidwalk_clear(), bm_uidwalk_pass_add(), bmw_EdgeLoopWalker_begin(), bmw_EdgeringWalker_begin(), bmw_FaceLoopWalker_begin(), BMW_reset(), knife_make_face_cuts(), make_structDNA(), and seam_connected().
| void BLI_gset_clear_ex | ( | GSet * | gs, |
| GSetKeyFreeFP | keyfreefp, | ||
| const uint | nentries_reserve ) |
Definition at line 1024 of file BLI_ghash.c.
References BLI_ghash_clear_ex(), and NULL.
| GSet * BLI_gset_copy | ( | const GSet * | gs, |
| GSetKeyCopyFP | keycopyfp ) |
Copy given GSet. Keys are also copied if callback is provided, else pointers remain the same.
Definition at line 949 of file BLI_ghash.c.
References ghash_copy(), and NULL.
| bool BLI_gset_ensure_p_ex | ( | GSet * | gs, |
| const void * | key, | ||
| void *** | r_key ) |
Set counterpart to BLI_ghash_ensure_p_ex. similar to BLI_gset_add, except it returns the key pointer.
Definition at line 971 of file BLI_ghash.c.
References BLI_mempool_alloc(), e, ghash_bucket_index(), ghash_insert_ex_keyonly_entry(), ghash_keyhash(), ghash_lookup_entry_ex(), hash, and NULL.
Referenced by BKE_collection_validate(), bm_edgering_pair_calc(), IMB_anim_index_rebuild_context(), object_base_unique(), WM_event_add_notifier_ex(), and WM_msg_subscribe_with_key().
Definition at line 1044 of file BLI_ghash.c.
Definition at line 1039 of file BLI_ghash.c.
References flag.
| void BLI_gset_free | ( | GSet * | gs, |
| GSetKeyFreeFP | keyfreefp ) |
Definition at line 1034 of file BLI_ghash.c.
References BLI_ghash_free(), and NULL.
Referenced by animdata_filter_remove_duplis(), animsys_evaluate_nla_domain(), BKE_collection_validate(), BKE_fcurves_calc_keyed_frames_ex(), BKE_library_make_local(), BKE_main_id_repair_duplicate_names_listbase(), BKE_main_idmap_destroy(), BKE_pose_check_uids_unique_and_report(), BKE_scene_objects_iterator_end(), BLO_blendhandle_get_linkable_groups(), bm_edgering_pair_calc(), BM_mesh_beautify_fill(), BM_mesh_intersect(), bm_uidwalk_free(), BM_uv_element_map_create(), bmo_grid_fill_exec(), bmo_subdivide_edgering_exec(), BMW_end(), bone_mouse_select_menu(), cachefile_handle_free(), blender::ed::outliner::collection_flag_exec(), blender::ed::outliner::collection_instance_exec(), blender::ed::outliner::collection_isolate_exec(), blender::ed::outliner::collection_link_exec(), blender::ed::outliner::collection_view_layer_exec(), blender::ed::outliner::collection_visibility_exec(), blender::ed::outliner::collections_view_layer_poll(), createTransObject(), drw_task_graph_deinit(), ED_image_save_all_modified_info(), gpu_node_graph_free(), IMB_thumb_locks_release(), join_tracks_exec(), knifetool_exit_ex(), lib_override_library_create_post_process(), library_foreach_ID_data_cleanup(), loop_find_regions(), blender::ed::object::make_override_library_exec(), make_structDNA(), blender::ed::object::object_xform_array_m4(), blender::ed::outliner::outliner_collection_delete(), blender::ed::outliner::outliner_delete_exec(), blender::ed::outliner::outliner_hide_exec(), py_bvhtree_overlap(), recalcData_pose(), screen_ctx_sel_actions_impl(), select_more_less_seq__internal(), blender::ed::outliner::selected_items_free(), seq_animation_duplicate(), SEQ_free_animdata(), SEQ_offset_animdata(), seq_proxy_build_job(), SEQ_relations_check_uids_unique_and_report(), sequencer_copy_animation_listbase(), sequencer_rebuild_proxy_exec(), similar_edge_select_exec(), similar_face_select_exec(), similar_vert_select_exec(), blender::ed::object::skin_root_mark_exec(), special_aftertrans_update__pose(), stats_update(), uv_rip_pairs_free(), uv_rip_single_free(), uv_select_overlap(), view_layer_add_used_lightgroups_exec(), view_layer_remove_unused_lightgroups_exec(), wm_close_and_free(), WM_msgbus_destroy(), and blender::ed::object::xform_skip_child_container_item_ensure_from_array().
| bool BLI_gset_haskey | ( | const GSet * | gs, |
| const void * | key ) |
Definition at line 1004 of file BLI_ghash.c.
References ghash_lookup_entry(), and NULL.
Referenced by BKE_main_idmap_lookup_id(), bm_edge_update_beauty_cost_single(), BM_mesh_beautify_fill(), BM_mesh_intersect(), bm_uidwalk_pass_add(), bmw_ConnectedVertexWalker_step(), bmw_ConnectedVertexWalker_visitVertex(), bmw_EdgeboundaryWalker_begin(), bmw_EdgeboundaryWalker_step(), bmw_EdgeLoopWalker_step(), bmw_EdgeringWalker_step(), bmw_FaceLoopWalker_include_face(), bmw_FaceShellWalker_visitEdge(), bmw_IslandboundWalker_step(), bmw_IslandWalker_step_ex(), bmw_LoopShellWalker_visitEdgeWire(), bmw_LoopShellWalker_visitLoop(), bmw_LoopShellWireWalker_visitVert(), bmw_NonManifoldedgeWalker_begin(), bmw_NonManifoldedgeWalker_step(), bmw_UVEdgeWalker_begin(), bmw_UVEdgeWalker_step(), bmw_VertShellWalker_visitEdge(), bone_mouse_select_menu(), createTransObject(), ED_image_save_all_modified_info(), blender::ed::outliner::is_edit_bone_selected(), blender::ed::outliner::is_object_selected(), blender::ed::outliner::is_pose_bone_selected(), library_make_local_copying_check(), loop_find_regions(), blender::ed::object::make_override_library_exec(), uv_rip_pairs_add(), uv_rip_pairs_remove(), view_layer_remove_unused_lightgroups_exec(), wm_msg_rna_update_by_id(), and blender::ed::object::xform_skip_child_container_item_ensure_from_array().
| void BLI_gset_insert | ( | GSet * | gs, |
| void * | key ) |
Adds the key to the set (no checks for unique keys!). Matching BLI_ghash_insert
Definition at line 959 of file BLI_ghash.c.
References ghash_bucket_index(), ghash_insert_ex_keyonly(), ghash_keyhash(), and hash.
Referenced by BKE_pose_check_uids_unique_and_report(), bm_isect_tri_tri(), BM_mesh_beautify_fill(), BM_mesh_intersect(), bm_uidwalk_pass_add(), bmw_ConnectedVertexWalker_visitVertex(), bmw_EdgeboundaryWalker_begin(), bmw_EdgeboundaryWalker_step(), bmw_EdgeLoopWalker_begin(), bmw_EdgeLoopWalker_step(), bmw_EdgeringWalker_begin(), bmw_EdgeringWalker_step(), bmw_FaceLoopWalker_begin(), bmw_FaceShellWalker_visitEdge(), bmw_IslandboundWalker_begin(), bmw_IslandboundWalker_step(), bmw_IslandWalker_begin(), bmw_IslandWalker_step_ex(), bmw_LoopShellWalker_visitEdgeWire(), bmw_LoopShellWalker_visitLoop(), bmw_LoopShellWireWalker_visitVert(), bmw_NonManifoldedgeWalker_begin(), bmw_NonManifoldedgeWalker_step(), bmw_UVEdgeWalker_begin(), bmw_UVEdgeWalker_step(), bmw_VertShellWalker_visitEdge(), bone_mouse_select_menu(), ED_image_save_all_modified_info(), get_uids_cb(), join_tracks_exec(), library_make_local_copying_check(), loop_find_region(), recalcData_pose(), and special_aftertrans_update__pose().
Definition at line 954 of file BLI_ghash.c.
Referenced by BKE_fcurves_calc_keyed_frames_ex(), BKE_library_make_local(), bm_edgering_pair_calc(), BM_mesh_intersect(), bm_uidwalk_pass_add(), bmo_subdivide_edgering_exec(), knife_make_face_cuts(), similar_vert_select_exec(), and uv_rip_pairs_calc_center_and_direction().
| void * BLI_gset_lookup | ( | const GSet * | gs, |
| const void * | key ) |
Returns the pointer to the key if it's found.
Definition at line 1058 of file BLI_ghash.c.
References e, ghash_lookup_entry(), and NULL.
Referenced by BKE_pose_check_uids_unique_and_report(), get_uids_cb(), lib_override_library_create_post_process(), blender::ed::object::object_parent_in_set(), WM_msg_lookup_rna(), and WM_msg_lookup_static().
| GSet * BLI_gset_new | ( | GSetHashFP | hashfp, |
| GSetCmpFP | cmpfp, | ||
| const char * | info ) |
Definition at line 944 of file BLI_ghash.c.
References BLI_gset_new_ex().
Referenced by BKE_main_gset_create(), BKE_pose_check_uids_unique_and_report(), erot_gset_new(), GPU_material_from_callbacks(), GPU_material_from_nodetree(), library_foreach_ID_link(), blender::ed::object::make_override_library_exec(), select_more_less_seq__internal(), blender::ed::outliner::selected_items_init(), seq_proxy_build_job(), SEQ_relations_check_uids_unique_and_report(), sequencer_rebuild_proxy_exec(), and stats_update().
| GSet * BLI_gset_new_ex | ( | GSetHashFP | hashfp, |
| GSetCmpFP | cmpfp, | ||
| const char * | info, | ||
| const uint | nentries_reserve ) |
Definition at line 936 of file BLI_ghash.c.
References ghash_new().
Referenced by BLI_gset_int_new_ex(), BLI_gset_new(), BLI_gset_pair_new_ex(), BLI_gset_ptr_new_ex(), BLI_gset_str_new_ex(), gset_bmelem_new_ex(), py_bvhtree_overlap(), uv_select_overlap(), WM_event_add_notifier_ex(), and WM_msgbus_create().
| bool BLI_gset_pop | ( | GSet * | gs, |
| GSetIterState * | state, | ||
| void ** | r_key ) |
Remove a random entry from gs, returning true if a key could be removed, false otherwise.
| r_key | The removed key. |
| state | Used for efficient removal. |
Definition at line 1009 of file BLI_ghash.c.
References BLI_mempool_free(), e, ghash_pop(), NULL, and state.
| void * BLI_gset_pop_key | ( | GSet * | gs, |
| const void * | key ) |
Returns the pointer to the key if it's found, removing it from the GSet.
Definition at line 1064 of file BLI_ghash.c.
References BLI_mempool_free(), e, ghash_bucket_index(), ghash_keyhash(), ghash_remove_ex(), hash, and NULL.
| bool BLI_gset_reinsert | ( | GSet * | gs, |
| void * | key, | ||
| GSetKeyFreeFP | keyfreefp ) |
Adds the key to the set (duplicates are managed). Matching BLI_ghash_reinsert
Definition at line 989 of file BLI_ghash.c.
References ghash_insert_safe_keyonly().
Referenced by BKE_cachefile_reader_open().
| bool BLI_gset_remove | ( | GSet * | gs, |
| const void * | key, | ||
| GSetKeyFreeFP | keyfreefp ) |
Definition at line 999 of file BLI_ghash.c.
References BLI_ghash_remove(), and NULL.
Referenced by BKE_cachefile_reader_free(), BKE_cachefile_reader_open(), BM_mesh_intersect(), IMB_thumb_path_unlock(), library_make_local_copying_check(), uv_rip_pairs_remove(), wm_event_do_notifiers(), WM_main_remove_notifier_reference(), wm_msg_rna_remove_by_id(), wm_msg_rna_update_by_id(), and WM_msgbus_clear_by_owner().
| void * BLI_gset_replace_key | ( | GSet * | gs, |
| void * | key ) |
Replaces the key to the set if it's found. Matching BLI_ghash_replace_key
Definition at line 994 of file BLI_ghash.c.
References BLI_ghash_replace_key().
| BLI_STATIC_ASSERT | ( | ARRAY_SIZE(hashsizes) | = =GHASH_MAX_SIZE, |
| "Invalid 'hashsizes' size" | ) |
| BLI_INLINE uint ghash_bucket_index | ( | const GHash * | gh, |
| const uint | hash ) |
Get the bucket-index for an already-computed full hash.
Definition at line 143 of file BLI_ghash.c.
References hash, and GHash::nbuckets.
Referenced by BLI_ghash_ensure_p(), BLI_ghash_ensure_p_ex(), BLI_ghash_popkey(), BLI_ghash_remove(), BLI_ghash_replace_key(), BLI_gset_ensure_p_ex(), BLI_gset_insert(), BLI_gset_pop_key(), ghash_buckets_resize(), ghash_insert(), ghash_insert_safe(), ghash_insert_safe_keyonly(), and ghash_lookup_entry().
|
static |
Definition at line 288 of file BLI_ghash.c.
References GHash::buckets, GHash::cursize, GHash::flag, ghash_buckets_resize(), GHASH_FLAG_ALLOW_SHRINK, GHASH_LIMIT_GROW, GHASH_LIMIT_SHRINK, hashsizes, LIKELY, GHash::limit_grow, GHash::limit_shrink, GHash::nbuckets, and GHash::size_min.
Referenced by BLI_ghash_reserve(), and ghash_remove_ex().
|
static |
Check if the number of items in the GHash is large enough to require more buckets, or small enough to require less buckets, and resize gh accordingly.
Definition at line 249 of file BLI_ghash.c.
References GHash::buckets, GHash::cursize, ghash_buckets_resize(), GHASH_LIMIT_GROW, GHASH_LIMIT_SHRINK, GHASH_MAX_SIZE, hashsizes, LIKELY, GHash::limit_grow, GHash::limit_shrink, GHash::nbuckets, and GHash::size_min.
Referenced by BLI_ghash_reserve(), ghash_buckets_reset(), ghash_copy(), ghash_insert_ex(), ghash_insert_ex_keyonly(), and ghash_insert_ex_keyonly_entry().
| BLI_INLINE void ghash_buckets_reset | ( | GHash * | gh, |
| const uint | nentries ) |
Clear and reset gh buckets, reserve again buckets for given number of entries.
Definition at line 337 of file BLI_ghash.c.
References GHash::buckets, GHash::cursize, ghash_buckets_expand(), GHASH_LIMIT_GROW, GHASH_LIMIT_SHRINK, hashsizes, GHash::limit_grow, GHash::limit_shrink, MEM_SAFE_FREE, GHash::nbuckets, GHash::nentries, and GHash::size_min.
Referenced by BLI_ghash_clear_ex(), and ghash_new().
Expand buckets to the next size up or down.
Definition at line 180 of file BLI_ghash.c.
References BLI_assert, GHash::buckets, e, ghash_bucket_index(), ghash_entryhash(), hash, MEM_callocN, MEM_freeN(), and GHash::nbuckets.
Referenced by ghash_buckets_contract(), and ghash_buckets_expand().
|
static |
Copy the GHash.
Definition at line 636 of file BLI_ghash.c.
References BLI_assert, BLI_mempool_alloc(), GHash::buckets, GHash::cmpfp, e, GHash::entrypool, GHash::flag, ghash_buckets_expand(), ghash_entry_copy(), GHASH_LIMIT_GROW, ghash_new(), GHash::hashfp, MAX2, GHash::nbuckets, GHash::nentries, and Entry::next.
Referenced by BLI_ghash_copy(), BLI_gset_copy(), and TEST().
| BLI_INLINE void ghash_entry_copy | ( | GHash * | gh_dst, |
| Entry * | dst, | ||
| const GHash * | gh_src, | ||
| const Entry * | src, | ||
| GHashKeyCopyFP | keycopyfp, | ||
| GHashValCopyFP | valcopyfp ) |
Definition at line 104 of file BLI_ghash.c.
References GHash::flag, Entry::key, and NULL.
Referenced by ghash_copy().
| BLI_INLINE uint ghash_entryhash | ( | const GHash * | gh, |
| const Entry * | e ) |
Get the full hash for an entry.
Definition at line 135 of file BLI_ghash.c.
References e, and GHash::hashfp.
Referenced by ghash_buckets_resize().
| BLI_INLINE uint ghash_find_next_bucket_index | ( | const GHash * | gh, |
| uint | curr_bucket ) |
Find the index of next used bucket, starting from curr_bucket (gh is assumed non-empty).
Definition at line 155 of file BLI_ghash.c.
References BLI_assert_unreachable, GHash::buckets, and GHash::nbuckets.
Referenced by ghash_pop().
|
static |
Run free callbacks for freeing entries.
Definition at line 612 of file BLI_ghash.c.
References BLI_assert, GHash::buckets, e, GHash::flag, and GHash::nbuckets.
Referenced by BLI_ghash_clear_ex(), and BLI_ghash_free().
| BLI_INLINE void ghash_insert | ( | GHash * | gh, |
| void * | key, | ||
| void * | val ) |
Definition at line 488 of file BLI_ghash.c.
References ghash_bucket_index(), ghash_insert_ex(), ghash_keyhash(), and hash.
Referenced by BLI_ghash_insert().
| BLI_INLINE void ghash_insert_ex | ( | GHash * | gh, |
| void * | key, | ||
| void * | val, | ||
| const uint | bucket_index ) |
Internal insert function. Takes hash and bucket_index arguments to avoid calling ghash_keyhash and ghash_bucket_index multiple times.
Definition at line 439 of file BLI_ghash.c.
References BLI_assert, BLI_ghash_haskey(), BLI_mempool_alloc(), GHash::buckets, BMVert::e, e, GHash::entrypool, GHash::flag, ghash_buckets_expand(), GHASH_FLAG_ALLOW_DUPES, and GHash::nentries.
Referenced by ghash_insert(), and ghash_insert_safe().
| BLI_INLINE void ghash_insert_ex_keyonly | ( | GHash * | gh, |
| void * | key, | ||
| const uint | bucket_index ) |
Insert function that doesn't set the value (use for GSet)
Definition at line 474 of file BLI_ghash.c.
References BLI_assert, BLI_ghash_haskey(), BLI_mempool_alloc(), GHash::buckets, e, GHash::entrypool, GHash::flag, ghash_buckets_expand(), GHASH_FLAG_ALLOW_DUPES, and GHash::nentries.
Referenced by BLI_gset_insert(), and ghash_insert_safe_keyonly().
| BLI_INLINE void ghash_insert_ex_keyonly_entry | ( | GHash * | gh, |
| void * | key, | ||
| const uint | bucket_index, | ||
| Entry * | e ) |
Insert function that takes a pre-allocated entry.
Definition at line 457 of file BLI_ghash.c.
References BLI_assert, BLI_ghash_haskey(), GHash::buckets, e, GHash::flag, ghash_buckets_expand(), GHASH_FLAG_ALLOW_DUPES, and GHash::nentries.
Referenced by BLI_ghash_ensure_p(), BLI_ghash_ensure_p_ex(), and BLI_gset_ensure_p_ex().
| BLI_INLINE bool ghash_insert_safe | ( | GHash * | gh, |
| void * | key, | ||
| void * | val, | ||
| const bool | override, | ||
| GHashKeyFreeFP | keyfreefp, | ||
| GHashValFreeFP | valfreefp ) |
Definition at line 496 of file BLI_ghash.c.
References BLI_assert, BMVert::e, e, GHash::flag, ghash_bucket_index(), ghash_insert_ex(), ghash_keyhash(), ghash_lookup_entry_ex(), and hash.
Referenced by BLI_ghash_reinsert().
| BLI_INLINE bool ghash_insert_safe_keyonly | ( | GHash * | gh, |
| void * | key, | ||
| const bool | override, | ||
| GHashKeyFreeFP | keyfreefp ) |
Definition at line 526 of file BLI_ghash.c.
References BLI_assert, e, GHash::flag, ghash_bucket_index(), ghash_insert_ex_keyonly(), ghash_keyhash(), ghash_lookup_entry_ex(), and hash.
Referenced by BLI_gset_add(), and BLI_gset_reinsert().
| BLI_INLINE uint ghash_keyhash | ( | const GHash * | gh, |
| const void * | key ) |
Get the full hash for a key.
Definition at line 127 of file BLI_ghash.c.
References GHash::hashfp.
Referenced by BLI_ghash_ensure_p(), BLI_ghash_ensure_p_ex(), BLI_ghash_popkey(), BLI_ghash_remove(), BLI_ghash_replace_key(), BLI_gset_ensure_p_ex(), BLI_gset_insert(), BLI_gset_pop_key(), ghash_insert(), ghash_insert_safe(), ghash_insert_safe_keyonly(), and ghash_lookup_entry().
| BLI_INLINE Entry * ghash_lookup_entry | ( | const GHash * | gh, |
| const void * | key ) |
Internal lookup function. Only wraps ghash_lookup_entry_ex
Definition at line 406 of file BLI_ghash.c.
References ghash_bucket_index(), ghash_keyhash(), ghash_lookup_entry_ex(), and hash.
Referenced by BLI_ghash_haskey(), BLI_ghash_lookup(), BLI_ghash_lookup_default(), BLI_ghash_lookup_p(), BLI_gset_haskey(), and BLI_gset_lookup().
| BLI_INLINE Entry * ghash_lookup_entry_ex | ( | const GHash * | gh, |
| const void * | key, | ||
| const uint | bucket_index ) |
Internal lookup function. Takes hash and bucket_index arguments to avoid calling ghash_keyhash and ghash_bucket_index multiple times.
Definition at line 365 of file BLI_ghash.c.
References GHash::buckets, GHash::cmpfp, e, NULL, and UNLIKELY.
Referenced by BLI_ghash_ensure_p(), BLI_ghash_ensure_p_ex(), BLI_ghash_replace_key(), BLI_gset_ensure_p_ex(), ghash_insert_safe(), ghash_insert_safe_keyonly(), and ghash_lookup_entry().
| BLI_INLINE Entry * ghash_lookup_entry_prev_ex | ( | GHash * | gh, |
| const void * | key, | ||
| Entry ** | r_e_prev, | ||
| const uint | bucket_index ) |
Internal lookup function, returns previous entry of target one too. Takes bucket_index argument to avoid calling ghash_keyhash and ghash_bucket_index multiple times. Useful when modifying buckets somehow (like removing an entry...).
Definition at line 385 of file BLI_ghash.c.
References GHash::buckets, GHash::cmpfp, e, NULL, and UNLIKELY.
Referenced by ghash_remove_ex().
|
static |
Definition at line 413 of file BLI_ghash.c.
References BLI_mempool_create(), BLI_MEMPOOL_NOP, GHash::buckets, GHash::cmpfp, GHash::entrypool, flag, GHash::flag, ghash_buckets_reset(), GHASH_ENTRY_SIZE, GHash::hashfp, MEM_mallocN, and NULL.
Referenced by BLI_ghash_new_ex(), BLI_gset_new_ex(), and ghash_copy().
|
static |
Remove a random entry and return it (or NULL if empty), caller must free from gh->entrypool.
Definition at line 588 of file BLI_ghash.c.
References BLI_assert, GHash::buckets, e, ghash_find_next_bucket_index(), ghash_remove_ex(), GHash::nentries, NULL, and state.
Referenced by BLI_ghash_pop(), and BLI_gset_pop().
|
static |
Remove the entry and return it, caller must free from gh->entrypool.
Definition at line 553 of file BLI_ghash.c.
References BLI_assert, GHash::buckets, e, GHash::flag, ghash_buckets_contract(), ghash_lookup_entry_prev_ex(), GHash::nentries, and Entry::next.
Referenced by BLI_ghash_popkey(), BLI_ghash_remove(), BLI_gset_pop_key(), and ghash_pop().
|
static |
Next prime after 2^n (skipping 2 & 3).
Definition at line 38 of file BLI_ghash.c.
Referenced by ghash_buckets_contract(), ghash_buckets_expand(), and ghash_buckets_reset().