|
Blender V4.3
|
Go to the source code of this file.
Classes | |
| struct | BLI_mempool_iter |
Typedefs | |
| typedef struct BLI_mempool | BLI_mempool |
| typedef struct BLI_mempool_iter | BLI_mempool_iter |
Enumerations | |
| enum | { BLI_MEMPOOL_NOP = 0 , BLI_MEMPOOL_ALLOW_ITER = (1 << 0) } |
| typedef struct BLI_mempool BLI_mempool |
Definition at line 21 of file BLI_mempool.h.
| typedef struct BLI_mempool_iter BLI_mempool_iter |
Iteration stuff.
| anonymous enum |
| Enumerator | |
|---|---|
| BLI_MEMPOOL_NOP | |
| BLI_MEMPOOL_ALLOW_ITER | Allow iterating on this mempool.
|
Definition at line 85 of file BLI_mempool.h.
| void * BLI_mempool_alloc | ( | BLI_mempool * | pool | ) |
Definition at line 402 of file BLI_mempool.c.
References BLI_asan_unpoison, BLI_assert, BLI_MEMPOOL_ALLOW_ITER, BLI_freenode::freeword, mempool_chunk_add(), mempool_chunk_alloc(), BLI_freenode::next, NULL, POISON_REDZONE_SIZE, UNLIKELY, USEDWORD, and VALGRIND_MEMPOOL_ALLOC.
Referenced by bchunk_list_append_only(), bchunk_list_new(), bchunk_new(), BKE_image_pool_acquire_ibuf(), BKE_main_idmap_insert_id(), BKE_main_idmap_lookup_name(), BLI_ghash_ensure_p(), BLI_ghash_ensure_p_ex(), BLI_gset_ensure_p_ex(), BLI_linklist_append_pool(), BLI_linklist_prepend_pool(), BLI_mempool_calloc(), BM_edge_create(), bm_face_create__internal(), bm_log_face_alloc(), bm_log_vert_alloc(), bm_loop_create(), BM_mesh_beautify_fill(), BM_mesh_rebuild(), bm_uidwalk_facestep_begin(), bm_uidwalk_pass_add(), BM_vert_create(), bmo_flag_layer_free(), BMW_state_add(), blender::ed::outliner::check_persistent(), CustomData_bmesh_alloc_block(), CustomData_bmesh_copy_block(), CustomData_bmesh_copy_block(), do_moviecache_put(), DRW_instance_data_next(), blender::bke::pbvh::edge_queue_insert(), ghash_copy(), ghash_insert_ex(), ghash_insert_ex_keyonly(), main_relations_create_idlink_cb(), blender::ed::outliner::outliner_space_blend_read_data(), blender::ed::outliner::outliner_storage_cleanup(), seq_cache_allocate_key(), seq_cache_put_ex(), state_link_add(), tbb_task_pool_run(), TEST(), TEST(), and vs_add().
| void BLI_mempool_as_array | ( | BLI_mempool * | pool, |
| void * | data ) |
Fill in data with the contents of the mempool.
| void void * BLI_mempool_as_arrayN | ( | BLI_mempool * | pool, |
| const char * | allocstr ) |
A version of BLI_mempool_as_array that allocates and returns the data.
Referenced by blender::ed::outliner::write_space_outliner().
| void * BLI_mempool_calloc | ( | BLI_mempool * | pool | ) |
Definition at line 443 of file BLI_mempool.c.
References BLI_mempool_alloc(), and POISON_REDZONE_SIZE.
Referenced by BM_edge_create(), bm_face_boundary_add(), bm_face_create__internal(), bm_face_create__sfme(), BM_mesh_elem_toolflags_ensure(), BM_mesh_rebuild(), BM_vert_create(), bmo_flag_layer_alloc(), bmo_planar_faces_exec(), blender::ed::curves::curve_draw_event_add(), curve_draw_event_add(), blender::ed::curves::curve_draw_stroke_from_operator_elem(), curve_draw_stroke_from_operator_elem(), do_versions_after_linking_280(), knife_append_list(), layer_collection_resync_create_recurse(), layer_collection_sync(), new_knife_edge(), and new_knife_vert().
| void BLI_mempool_clear | ( | BLI_mempool * | pool | ) |
Wrap BLI_mempool_clear_ex with no reserve set.
Definition at line 856 of file BLI_mempool.c.
References BLI_mempool_clear_ex().
Referenced by BLI_array_store_clear(), bm_uidwalk_clear(), bmo_planar_faces_exec(), and tbb_task_pool_work_and_wait().
| void void BLI_mempool_clear_ex | ( | BLI_mempool * | pool, |
| int | elem_num_reserve ) |
Empty the pool, as if it were just created.
| pool | The pool to clear. |
| elem_num_reserve | Optionally reserve how many items should be kept from clearing. |
Definition at line 808 of file BLI_mempool.c.
References mempool_chunk_add(), mempool_chunk_find(), mempool_chunk_free(), mempool_maxchunks(), BLI_mempool_chunk::next, NULL, VALGRIND_CREATE_MEMPOOL, and VALGRIND_DESTROY_MEMPOOL.
Referenced by BLI_ghash_clear_ex(), BLI_mempool_clear(), and DRW_instance_data_list_resize().
| BLI_mempool * BLI_mempool_create | ( | unsigned int | esize, |
| unsigned int | elem_num, | ||
| unsigned int | pchunk, | ||
| unsigned int | flag ) |
Definition at line 333 of file BLI_mempool.c.
References BLI_assert, BLI_MEMPOOL_ALLOW_ITER, BLI_mutex_init(), CHUNK_OVERHEAD, flag, int, MAX2, MEM_mallocN, MEM_SIZE_OVERHEAD, mempool_chunk_add(), mempool_chunk_alloc(), MEMPOOL_ELEM_SIZE_MIN, mempool_maxchunks(), NULL, POISON_REDZONE_SIZE, power_of_2_max_u(), and VALGRIND_CREATE_MEMPOOL.
Referenced by BKE_image_pool_new(), BKE_layer_collection_sync(), BKE_main_idmap_lookup_name(), BKE_main_relations_create(), BLI_array_store_create(), bm_log_entry_create(), bm_mempool_init(), bm_mempool_init_ex(), BM_mesh_beautify_fill(), BM_mesh_edgeloops_find_path(), BM_mesh_edgenet(), BM_mesh_elem_toolflags_ensure(), bm_uidwalk_init(), blender::bke::pbvh::bmesh_update_topology(), bmo_connect_vert_pair_exec(), bmo_flag_layer_alloc(), bmo_flag_layer_free(), bmo_planar_faces_exec(), BMW_init(), blender::ed::outliner::check_persistent(), blender::ed::curves::curve_draw_init(), curve_draw_init(), CustomData_bmesh_init_pool(), do_versions_after_linking_280(), drw_instance_data_create(), ghash_new(), IMB_moviecache_create(), knifetool_init(), blender::ed::outliner::outliner_space_blend_read_data(), blender::ed::outliner::outliner_storage_cleanup(), seq_cache_create(), tbb_task_pool_create(), TEST(), and TEST().
| void BLI_mempool_destroy | ( | BLI_mempool * | pool | ) |
Free the mempool itself (and all elements).
Definition at line 861 of file BLI_mempool.c.
References MEM_freeN(), mempool_chunk_free_all(), and VALGRIND_DESTROY_MEMPOOL.
Referenced by BKE_image_pool_free(), BKE_layer_collection_sync(), BKE_main_idmap_destroy(), BKE_main_relations_free(), BLI_array_store_destroy(), BLI_ghash_free(), BLO_update_defaults_startup_blend(), bm_log_entry_free(), BM_mesh_beautify_fill(), BM_mesh_data_free(), BM_mesh_edgeloops_find_path(), BM_mesh_edgenet(), BM_mesh_elem_toolflags_clear(), BM_mesh_rebuild(), BM_mesh_toolflags_set(), bm_uidwalk_free(), blender::bke::pbvh::bmesh_update_topology(), bmo_connect_vert_pair_exec(), bmo_flag_layer_alloc(), bmo_flag_layer_free(), bmo_planar_faces_exec(), BMW_end(), blender::ed::curves::curve_draw_exit(), curve_draw_exit(), CustomData_bmesh_merge_layout(), DRW_instance_data_free(), IMB_moviecache_free(), knifetool_exit_ex(), blender::ed::outliner::outliner_free(), blender::ed::outliner::outliner_storage_cleanup(), seq_cache_destruct(), tbb_task_pool_free(), TEST(), TEST(), and update_data_blocks().
| void * BLI_mempool_findelem | ( | BLI_mempool * | pool, |
| unsigned int | index ) |
Definition at line 552 of file BLI_mempool.c.
References BLI_assert, BLI_MEMPOOL_ALLOW_ITER, BLI_mempool_iternew(), BLI_mempool_iterstep(), mempool_asan_lock(), mempool_asan_unlock(), and NULL.
Referenced by BM_edge_at_index_find(), BM_face_at_index_find(), and BM_vert_at_index_find().
| void BLI_mempool_free | ( | BLI_mempool * | pool, |
| void * | addr ) |
Free an element from the mempool.
Referenced by bchunk_decref(), bchunk_list_decref(), bchunk_list_ensure_min_size_last(), BLI_ghash_pop(), BLI_ghash_popkey(), BLI_ghash_remove(), BLI_gset_pop(), BLI_gset_pop_key(), BLI_linklist_free_pool(), BLI_linklist_pop_pool(), BM_face_kill(), BM_face_kill_loose(), bm_kill_only_edge(), bm_kill_only_face(), bm_kill_only_loop(), bm_kill_only_vert(), bm_loop_path_build_step(), bm_uidwalk_facestep_begin(), bm_uidwalk_facestep_end(), bm_uidwalk_facestep_free(), bmesh_kernel_join_face_kill_edge(), bmesh_kernel_split_face_make_edge(), BMW_state_remove(), CustomData_bmesh_free_block(), moviecache_keyfree(), moviecache_valfree(), blender::bke::pbvh::pbvh_bmesh_collapse_short_edges(), blender::bke::pbvh::pbvh_bmesh_subdivide_long_edges(), seq_cache_keyfree(), seq_cache_valfree(), and TEST().
| void BLI_mempool_iternew | ( | BLI_mempool * | pool, |
| BLI_mempool_iter * | iter ) |
Initialize a new mempool iterator, BLI_MEMPOOL_ALLOW_ITER flag must be set.
Definition at line 600 of file BLI_mempool.c.
References BLI_assert, BLI_MEMPOOL_ALLOW_ITER, BLI_mempool_iter::curchunk, BLI_mempool_iter::curindex, and BLI_mempool_iter::pool.
Referenced by array_store_free_data(), BLI_array_store_calc_size_compacted_get(), BLI_array_store_is_valid(), BLI_mempool_as_array(), BLI_mempool_findelem(), BLI_task_parallel_mempool(), bmiter__elem_of_mesh_begin(), curve_draw_exec(), blender::ed::curves::curve_draw_exec_precalc(), curve_draw_exec_precalc(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), blender::ed::curves::curve_draw_stroke_to_operator(), curve_draw_stroke_to_operator(), blender::ed::curves::curves_draw_exec(), knife_make_cuts(), knifetool_draw(), knifetool_undo(), mempool_threadsafe_iternew(), blender::ed::outliner::outliner_foreach_id(), blender::ed::outliner::outliner_id_remap(), blender::ed::outliner::outliner_space_blend_read_after_liblink(), blender::ed::outliner::outliner_storage_cleanup(), and tbb_task_pool_work_and_wait().
| void * BLI_mempool_iterstep | ( | BLI_mempool_iter * | iter | ) |
Step over the iterator, returning the mempool item or NULL.
Definition at line 679 of file BLI_mempool.c.
References BLI_asan_poison, BLI_asan_unpoison, CHUNK_DATA, BLI_mempool_iter::curchunk, BLI_mempool_iter::curindex, BLI_mempool::esize, FREEWORD, BLI_mempool_chunk::next, NULL, BLI_mempool::pchunk, POINTER_OFFSET, POISON_REDZONE_SIZE, BLI_mempool_iter::pool, ret, and UNLIKELY.
Referenced by array_store_free_data(), BLI_array_store_calc_size_compacted_get(), BLI_array_store_is_valid(), BLI_mempool_as_array(), BLI_mempool_findelem(), BLI_task_parallel_mempool(), bmiter__elem_of_mesh_step(), curve_draw_exec(), blender::ed::curves::curve_draw_exec_precalc(), curve_draw_exec_precalc(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), blender::ed::curves::curve_draw_stroke_to_operator(), curve_draw_stroke_to_operator(), blender::ed::curves::curves_draw_exec(), knife_make_cuts(), knifetool_draw(), knifetool_undo(), blender::ed::outliner::outliner_foreach_id(), blender::ed::outliner::outliner_id_remap(), blender::ed::outliner::outliner_space_blend_read_after_liblink(), blender::ed::outliner::outliner_storage_cleanup(), and tbb_task_pool_work_and_wait().
| int BLI_mempool_len | ( | const BLI_mempool * | pool | ) |
Definition at line 545 of file BLI_mempool.c.
Referenced by BLI_array_store_is_valid(), BLI_ghash_free(), BLI_task_parallel_mempool(), BM_mesh_edgenet(), bmiter__elem_of_mesh_begin(), bmiter__elem_of_mesh_step(), blender::ed::outliner::TreeDisplayDataAPI::build_tree(), blender::ed::outliner::TreeDisplayScenes::build_tree(), curve_draw_exec(), blender::ed::curves::curve_draw_exec_precalc(), curve_draw_exec_precalc(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), blender::ed::curves::curves_draw_exec(), DRW_instance_data_list_resize(), knifetool_draw(), blender::ed::outliner::outliner_storage_cleanup(), and blender::ed::outliner::write_space_outliner().
| void void void BLI_mempool_set_memory_debug | ( | void | ) |
Definition at line 873 of file BLI_mempool.c.
References mempool_debug_memset.
Referenced by arg_handle_debug_mode_set().