|
Blender V5.3
|
Go to the source code of this file.
Macros | |
| #define | UNUSED(x) |
| #define | USE_MALLOC_USABLE_SIZE |
| #define | SIZET_FORMAT "%zu" |
| #define | SIZET_ARG(a) |
| #define | SIZET_ALIGN_4(len) |
| #define | LIKELY(x) |
| #define | UNLIKELY(x) |
| #define | MEM_INLINE static inline |
| #define | IS_POW2(a) |
| #define | MEMHEAD_ALIGN_PADDING(alignment) |
| #define | MEMHEAD_REAL_PTR(memh) |
| #define | ALIGNED_MALLOC_MINIMUM_ALIGNMENT sizeof(void *) |
Variables | |
| bool | leak_detector_has_run |
| char | free_after_leak_detection_message [] |
| void(*) | mem_clearmemlist (void) |
| #define ALIGNED_MALLOC_MINIMUM_ALIGNMENT sizeof(void *) |
Definition at line 85 of file mallocn_intern.hh.
Referenced by aligned_malloc(), MEM_guarded_mallocN_aligned(), and MEM_lockfree_mallocN_aligned().
| #define IS_POW2 | ( | a | ) |
Definition at line 74 of file mallocn_intern.hh.
Referenced by MEM_guarded_mallocN_aligned(), and MEM_lockfree_mallocN_aligned().
| #define LIKELY | ( | x | ) |
Definition at line 54 of file mallocn_intern.hh.
| #define MEM_INLINE static inline |
Definition at line 71 of file mallocn_intern.hh.
Referenced by MEM_trigger_error_on_memory_block().
| #define MEMHEAD_ALIGN_PADDING | ( | alignment | ) |
Definition at line 77 of file mallocn_intern.hh.
Referenced by MEM_guarded_mallocN_aligned(), MEM_lockfree_mallocN_aligned(), report_error_on_address(), and report_error_on_address().
| #define MEMHEAD_REAL_PTR | ( | memh | ) |
Definition at line 81 of file mallocn_intern.hh.
Referenced by MEM_lockfree_freeN(), rem_memblock(), report_error_on_address(), and report_error_on_address().
| #define SIZET_ALIGN_4 | ( | len | ) |
Definition at line 46 of file mallocn_intern.hh.
Referenced by MEM_guarded_callocN(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEM_lockfree_callocN(), MEM_lockfree_mallocN(), and MEM_lockfree_mallocN_aligned().
| #define SIZET_ARG | ( | a | ) |
Definition at line 44 of file mallocn_intern.hh.
Referenced by MEM_guarded_calloc_arrayN(), MEM_guarded_callocN(), MEM_guarded_malloc_arrayN(), mem_guarded_malloc_arrayN_aligned(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEM_guarded_printmemlist_internal(), MEM_lockfree_calloc_arrayN(), MEM_lockfree_callocN(), MEM_lockfree_malloc_arrayN(), mem_lockfree_malloc_arrayN_aligned(), MEM_lockfree_mallocN(), and MEM_lockfree_mallocN_aligned().
| #define SIZET_FORMAT "%zu" |
Definition at line 43 of file mallocn_intern.hh.
Referenced by MEM_guarded_calloc_arrayN(), MEM_guarded_callocN(), MEM_guarded_malloc_arrayN(), mem_guarded_malloc_arrayN_aligned(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEM_guarded_printmemlist_internal(), MEM_lockfree_calloc_arrayN(), MEM_lockfree_callocN(), MEM_lockfree_malloc_arrayN(), mem_lockfree_malloc_arrayN_aligned(), MEM_lockfree_mallocN(), and MEM_lockfree_mallocN_aligned().
| #define UNLIKELY | ( | x | ) |
Definition at line 55 of file mallocn_intern.hh.
| #define UNUSED | ( | x | ) |
Definition at line 16 of file mallocn_intern.hh.
| #define USE_MALLOC_USABLE_SIZE |
Definition at line 20 of file mallocn_intern.hh.
| void aligned_free | ( | void * | ptr | ) |
Definition at line 99 of file mallocn.cc.
References aligned_free(), and PRF_memory_free.
Referenced by aligned_free(), MEM_lockfree_freeN(), and rem_memblock().
| void * aligned_malloc | ( | size_t | size, |
| size_t | alignment ) |
Definition at line 77 of file mallocn.cc.
References aligned_malloc(), ALIGNED_MALLOC_MINIMUM_ALIGNMENT, and assert.
Referenced by aligned_malloc(), MEM_guarded_mallocN_aligned(), and MEM_lockfree_mallocN_aligned().
| void ATTR_NONNULL | ( | 3 | ) |
References ATTR_ALLOC_SIZE, ATTR_MALLOC, ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, len(), MEM_lockfree_mallocN(), and str.
| void * ATTR_NONNULL | ( | 4 | ) |
References ATTR_ALLOC_SIZE, and ATTR_NONNULL.
| size_t MEM_guarded_allocN_len | ( | const void * | vmemh | ) |
Definition at line 310 of file mallocn_guarded_impl.cc.
References MEM_guarded_allocN_len().
Referenced by MEM_guarded_allocN_len(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void MEM_guarded_callbackmemlist | ( | void(* | func )(void *) | ) |
Definition at line 985 of file mallocn_guarded_impl.cc.
References localListBase::first, MEM_guarded_callbackmemlist(), mem_lock_thread(), mem_unlock_thread(), membase, and MEMNEXT.
Referenced by MEM_guarded_callbackmemlist(), MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void * MEM_guarded_calloc_arrayN | ( | size_t | len, |
| size_t | size, | ||
| const char * | str ) |
References ATTR_ALLOC_SIZE, ATTR_MALLOC, ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, len(), MEM_guarded_calloc_arrayN(), MEM_guarded_mallocN(), size(), and str.
| void * MEM_guarded_calloc_arrayN_aligned | ( | size_t | len, |
| size_t | size, | ||
| size_t | alignment, | ||
| const char * | str ) |
References ATTR_ALLOC_SIZE, ATTR_MALLOC, ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, len(), MEM_guarded_callbackmemlist(), MEM_guarded_calloc_arrayN_aligned(), mem_guarded_clearmemlist(), MEM_guarded_consistency_check(), MEM_guarded_get_memory_blocks_in_use(), MEM_guarded_get_memory_in_use(), MEM_guarded_get_peak_memory(), MEM_guarded_name_ptr(), MEM_guarded_name_ptr_set(), MEM_guarded_printmemlist(), MEM_guarded_printmemlist_pydict(), MEM_guarded_printmemlist_stats(), MEM_guarded_reset_peak_memory(), MEM_guarded_set_error_callback(), MEM_guarded_set_memory_debug(), size(), and str.
| void * MEM_guarded_callocN | ( | size_t | len, |
| const char * | str ) |
Definition at line 675 of file mallocn_guarded_impl.cc.
References blender::Core, len(), make_memhead_header(), MEM_guarded_callocN(), mem_in_use, PRF_memory_alloc, PRF_scope, print_error(), SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, and mem_guarded::internal::Trivial.
Referenced by MEM_guarded_calloc_arrayN(), MEM_guarded_callocN(), MEM_guarded_recallocN_id(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void mem_guarded_clearmemlist | ( | void | ) |
Definition at line 1048 of file mallocn_guarded_impl.cc.
References localListBase::first, localListBase::last, mem_guarded_clearmemlist(), and membase.
Referenced by MEM_guarded_calloc_arrayN_aligned(), mem_guarded_clearmemlist(), and MEM_use_guarded_allocator().
| bool MEM_guarded_consistency_check | ( | void | ) |
Definition at line 287 of file mallocn_guarded_impl.cc.
References check_memlist(), localListBase::last, MEM_guarded_consistency_check(), and membase.
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_consistency_check(), and MEM_use_guarded_allocator().
| void * MEM_guarded_dupallocN | ( | const void * | vmemh | ) |
Definition at line 322 of file mallocn_guarded_impl.cc.
References blender::Core, MEM_guarded_dupallocN(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEMHEAD_FLAG_NONTRIVIAL_DESTRUCTOR, PRF_scope, report_error_on_address(), and mem_guarded::internal::Trivial.
Referenced by MEM_guarded_dupallocN(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void MEM_guarded_freeN | ( | void * | vmemh, |
| mem_guarded::internal::DestructorType | destructor_type ) |
Definition at line 1054 of file mallocn_guarded_impl.cc.
References check_memlist(), free_after_leak_detection_message, leak_detector_has_run, MEM_guarded_freeN(), mem_lock_thread(), mem_unlock_thread(), MEMFREE, MEMHEAD_FLAG_NONTRIVIAL_DESTRUCTOR, MemorY_ErroR(), MEMTAG1, MEMTAG2, MEMTAG3, mem_guarded::internal::NonTrivial, rem_memblock(), report_error_on_address(), MemTail::tag3, and totblock.
Referenced by MEM_guarded_freeN(), MEM_guarded_reallocN_id(), MEM_guarded_recallocN_id(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| unsigned int MEM_guarded_get_memory_blocks_in_use | ( | void | ) |
Definition at line 1401 of file mallocn_guarded_impl.cc.
References MEM_guarded_get_memory_blocks_in_use(), mem_lock_thread(), mem_unlock_thread(), and totblock.
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_get_memory_blocks_in_use(), and MEM_use_guarded_allocator().
| size_t MEM_guarded_get_memory_in_use | ( | void | ) |
Definition at line 1390 of file mallocn_guarded_impl.cc.
References MEM_guarded_get_memory_in_use(), mem_in_use, mem_lock_thread(), and mem_unlock_thread().
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_get_memory_in_use(), and MEM_use_guarded_allocator().
| size_t MEM_guarded_get_peak_memory | ( | void | ) |
Definition at line 1372 of file mallocn_guarded_impl.cc.
References MEM_guarded_get_peak_memory(), mem_lock_thread(), mem_unlock_thread(), and peak_mem.
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_get_peak_memory(), and MEM_use_guarded_allocator().
| void * MEM_guarded_malloc_arrayN | ( | size_t | len, |
| size_t | size, | ||
| const char * | str ) |
| void * MEM_guarded_malloc_arrayN_aligned | ( | size_t | len, |
| size_t | size, | ||
| size_t | alignment, | ||
| const char * | str ) |
References ATTR_ALLOC_SIZE, ATTR_MALLOC, ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, len(), MEM_guarded_malloc_arrayN_aligned(), size(), and str.
| void * MEM_guarded_mallocN | ( | size_t | len, |
| const char * | str ) |
Definition at line 536 of file mallocn_guarded_impl.cc.
References blender::Core, len(), make_memhead_header(), malloc_debug_memset, MEM_guarded_mallocN(), mem_in_use, PRF_memory_alloc, PRF_scope, print_error(), SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, and mem_guarded::internal::Trivial.
Referenced by MEM_guarded_calloc_arrayN(), MEM_guarded_dupallocN(), MEM_guarded_malloc_arrayN(), MEM_guarded_mallocN(), MEM_guarded_reallocN_id(), MEM_guarded_recallocN_id(), and MEM_use_guarded_allocator().
| void * MEM_guarded_mallocN_aligned | ( | size_t | len, |
| size_t | alignment, | ||
| const char * | str, | ||
| mem_guarded::internal::DestructorType | destructor_type ) |
Definition at line 600 of file mallocn_guarded_impl.cc.
References aligned_malloc(), ALIGNED_MALLOC_MINIMUM_ALIGNMENT, assert, blender::Core, IS_POW2, len(), make_memhead_header(), malloc_debug_memset, MEM_guarded_mallocN_aligned(), mem_in_use, MEMHEAD_ALIGN_PADDING, PRF_memory_alloc, PRF_scope, print_error(), SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, and str.
Referenced by MEM_guarded_dupallocN(), MEM_guarded_malloc_arrayN(), MEM_guarded_mallocN_aligned(), MEM_guarded_reallocN_id(), MEM_guarded_recallocN_id(), and MEM_use_guarded_allocator().
| const char * MEM_guarded_name_ptr | ( | void * | vmemh | ) |
Definition at line 1413 of file mallocn_guarded_impl.cc.
References MEM_guarded_name_ptr().
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_name_ptr(), and MEM_use_guarded_allocator().
| void MEM_guarded_name_ptr_set | ( | void * | vmemh, |
| const char * | str ) |
Definition at line 1424 of file mallocn_guarded_impl.cc.
References MEM_guarded_name_ptr_set(), MEMNEXT, and str.
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_name_ptr_set(), and MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist | ( | void | ) |
Definition at line 1040 of file mallocn_guarded_impl.cc.
References MEM_guarded_printmemlist(), and MEM_guarded_printmemlist_internal().
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_printmemlist(), and MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist_pydict | ( | void | ) |
Definition at line 1044 of file mallocn_guarded_impl.cc.
References MEM_guarded_printmemlist_internal(), and MEM_guarded_printmemlist_pydict().
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_printmemlist_pydict(), and MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist_stats | ( | void | ) |
Definition at line 801 of file mallocn_guarded_impl.cc.
References b, compare_len(), compare_name(), localListBase::first, MemPrintBlock::items, MemPrintBlock::len, MEM_guarded_printmemlist_stats(), mem_in_use, mem_lock_thread(), mem_unlock_thread(), membase, MEMNEXT, MemPrintBlock::name, peak_mem, print_error(), printf, and totblock.
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_printmemlist_stats(), and MEM_use_guarded_allocator().
| void * MEM_guarded_reallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str ) |
Definition at line 383 of file mallocn_guarded_impl.cc.
References blender::Core, len(), MEM_guarded_freeN(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEM_guarded_reallocN_id(), MEMHEAD_FLAG_NONTRIVIAL_DESTRUCTOR, PRF_scope, report_error_on_address(), str, and mem_guarded::internal::Trivial.
Referenced by MEM_guarded_reallocN_id(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void * MEM_guarded_recallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str ) |
Definition at line 427 of file mallocn_guarded_impl.cc.
References blender::Core, len(), MEM_guarded_callocN(), MEM_guarded_freeN(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEM_guarded_recallocN_id(), MEMHEAD_FLAG_NONTRIVIAL_DESTRUCTOR, PRF_scope, report_error_on_address(), str, and mem_guarded::internal::Trivial.
Referenced by MEM_guarded_recallocN_id(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void MEM_guarded_reset_peak_memory | ( | void | ) |
Definition at line 1383 of file mallocn_guarded_impl.cc.
References MEM_guarded_reset_peak_memory(), mem_in_use, mem_lock_thread(), mem_unlock_thread(), and peak_mem.
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_reset_peak_memory(), and MEM_use_guarded_allocator().
| void MEM_guarded_set_error_callback | ( | void(* | func )(const char *) | ) |
Definition at line 300 of file mallocn_guarded_impl.cc.
References error_callback, and MEM_guarded_set_error_callback().
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_set_error_callback(), and MEM_use_guarded_allocator().
| void MEM_guarded_set_memory_debug | ( | void | ) |
Definition at line 305 of file mallocn_guarded_impl.cc.
References malloc_debug_memset, and MEM_guarded_set_memory_debug().
Referenced by MEM_guarded_calloc_arrayN_aligned(), MEM_guarded_set_memory_debug(), and MEM_use_guarded_allocator().
| size_t MEM_lockfree_allocN_len | ( | const void * | vmemh | ) |
Definition at line 137 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_allocN_len(), MEMHEAD_FROM_PTR, and MEMHEAD_LEN.
Referenced by MEM_lockfree_allocN_len(), MEM_lockfree_dupallocN(), MEM_lockfree_reallocN_id(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_callbackmemlist | ( | void(* | func )(void *) | ) |
Definition at line 541 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_callbackmemlist().
Referenced by MEM_lockfree_callbackmemlist(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_calloc_arrayN | ( | size_t | len, |
| size_t | size, | ||
| const char * | str ) |
References ATTR_MALLOC, ATTR_WARN_UNUSED_RESULT, len(), MEM_lockfree_calloc_arrayN(), size(), and str.
Referenced by MEM_lockfree_calloc_arrayN(), MEM_lockfree_calloc_arrayN(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_calloc_arrayN_aligned | ( | size_t | len, |
| size_t | size, | ||
| size_t | alignment, | ||
| const char * | str ) |
References ATTR_ALLOC_SIZE, ATTR_MALLOC, ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, len(), MEM_guarded_allocN_len(), MEM_guarded_callocN(), MEM_guarded_dupallocN(), MEM_guarded_freeN(), MEM_guarded_reallocN_id(), MEM_guarded_recallocN_id(), MEM_lockfree_callbackmemlist(), MEM_lockfree_calloc_arrayN_aligned(), mem_lockfree_clearmemlist(), MEM_lockfree_consistency_check(), MEM_lockfree_get_memory_blocks_in_use(), MEM_lockfree_get_memory_in_use(), MEM_lockfree_get_peak_memory(), MEM_lockfree_name_ptr(), MEM_lockfree_name_ptr_set(), MEM_lockfree_printmemlist(), MEM_lockfree_printmemlist_pydict(), MEM_lockfree_printmemlist_stats(), MEM_lockfree_reset_peak_memory(), MEM_lockfree_set_error_callback(), MEM_lockfree_set_memory_debug(), size(), and str.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_callocN | ( | size_t | len, |
| const char * | str ) |
Definition at line 304 of file mallocn_lockfree_impl.cc.
References blender::Core, len(), MEM_lockfree_callocN(), memory_usage_block_alloc(), memory_usage_current(), PRF_memory_alloc, PRF_scope, print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, and str.
Referenced by MEM_lockfree_calloc_arrayN(), MEM_lockfree_callocN(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| void mem_lockfree_clearmemlist | ( | void | ) |
Definition at line 537 of file mallocn_lockfree_impl.cc.
References mem_lockfree_clearmemlist().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), mem_lockfree_clearmemlist(), and MEM_use_lockfree_allocator().
| bool MEM_lockfree_consistency_check | ( | void | ) |
Definition at line 565 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_consistency_check().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_consistency_check(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_dupallocN | ( | const void * | vmemh | ) |
Definition at line 182 of file mallocn_lockfree_impl.cc.
References blender::Core, MEM_lockfree_allocN_len(), MEM_lockfree_dupallocN(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_HAS_NONTRIVIAL_DESTRUCTOR, MEMHEAD_IS_ALIGNED, PRF_scope, report_error_on_address(), and mem_guarded::internal::Trivial.
Referenced by MEM_lockfree_dupallocN(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_freeN | ( | void * | vmemh, |
| mem_guarded::internal::DestructorType | destructor_type ) |
Definition at line 146 of file mallocn_lockfree_impl.cc.
References aligned_free(), blender::Core, free_after_leak_detection_message, leak_detector_has_run, len(), malloc_debug_memset, MEM_lockfree_freeN(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_HAS_NONTRIVIAL_DESTRUCTOR, MEMHEAD_IS_ALIGNED, MEMHEAD_LEN, MEMHEAD_REAL_PTR, memory_usage_block_free(), mem_guarded::internal::NonTrivial, PRF_memory_free, PRF_scope, print_error(), and report_error_on_address().
Referenced by MEM_lockfree_freeN(), MEM_lockfree_reallocN_id(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| unsigned int MEM_lockfree_get_memory_blocks_in_use | ( | void | ) |
Definition at line 580 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_get_memory_blocks_in_use(), and memory_usage_block_num().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_get_memory_blocks_in_use(), and MEM_use_lockfree_allocator().
| size_t MEM_lockfree_get_memory_in_use | ( | void | ) |
Definition at line 575 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_get_memory_in_use(), and memory_usage_current().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_get_memory_in_use(), and MEM_use_lockfree_allocator().
| size_t MEM_lockfree_get_peak_memory | ( | void | ) |
Definition at line 592 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_get_peak_memory(), and memory_usage_peak().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_get_peak_memory(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_malloc_arrayN | ( | size_t | len, |
| size_t | size, | ||
| const char * | str ) |
References ATTR_ALLOC_SIZE, ATTR_MALLOC, ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, len(), MEM_lockfree_malloc_arrayN(), MEM_lockfree_mallocN_aligned(), size(), and str.
Referenced by MEM_lockfree_malloc_arrayN(), MEM_lockfree_malloc_arrayN(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_malloc_arrayN_aligned | ( | size_t | len, |
| size_t | size, | ||
| size_t | alignment, | ||
| const char * | str ) |
References ATTR_MALLOC, ATTR_WARN_UNUSED_RESULT, len(), MEM_lockfree_malloc_arrayN_aligned(), size(), and str.
Referenced by MEM_lockfree_malloc_arrayN_aligned(), MEM_lockfree_malloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_mallocN | ( | size_t | len, |
| const char * | str ) |
Definition at line 346 of file mallocn_lockfree_impl.cc.
References blender::Core, len(), malloc_debug_memset, MEM_lockfree_mallocN(), memory_usage_block_alloc(), memory_usage_current(), PRF_memory_alloc, PRF_scope, print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, and str.
Referenced by ATTR_NONNULL(), MEM_lockfree_dupallocN(), MEM_lockfree_malloc_arrayN(), MEM_lockfree_mallocN(), MEM_lockfree_reallocN_id(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_mallocN_aligned | ( | size_t | len, |
| size_t | alignment, | ||
| const char * | str, | ||
| mem_guarded::internal::DestructorType | destructor_type ) |
Definition at line 406 of file mallocn_lockfree_impl.cc.
References aligned_malloc(), ALIGNED_MALLOC_MINIMUM_ALIGNMENT, assert, blender::Core, IS_POW2, len(), malloc_debug_memset, MEM_lockfree_mallocN_aligned(), MEMHEAD_ALIGN_PADDING, MEMHEAD_FLAG_ALIGN, MEMHEAD_FLAG_NONTRIVIAL_DESTRUCTOR, memory_usage_block_alloc(), memory_usage_current(), mem_guarded::internal::NonTrivial, PRF_memory_alloc, PRF_scope, print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, and str.
Referenced by MEM_lockfree_dupallocN(), MEM_lockfree_malloc_arrayN(), MEM_lockfree_mallocN_aligned(), MEM_lockfree_reallocN_id(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| const char * MEM_lockfree_name_ptr | ( | void * | vmemh | ) |
Definition at line 598 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_name_ptr().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_name_ptr(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_name_ptr_set | ( | void * | vmemh, |
| const char * | str ) |
Definition at line 607 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_name_ptr_set().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_name_ptr_set(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist | ( | void | ) |
Definition at line 535 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_printmemlist().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_printmemlist(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist_pydict | ( | void | ) |
Definition at line 533 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_printmemlist_pydict().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_printmemlist_pydict(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist_stats | ( | void | ) |
Definition at line 546 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_printmemlist_stats(), memory_usage_current(), memory_usage_peak(), and printf.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_printmemlist_stats(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_reallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str ) |
Definition at line 209 of file mallocn_lockfree_impl.cc.
References blender::Core, len(), MEM_lockfree_allocN_len(), MEM_lockfree_freeN(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), MEM_lockfree_reallocN_id(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_HAS_NONTRIVIAL_DESTRUCTOR, MEMHEAD_IS_ALIGNED, PRF_scope, report_error_on_address(), str, and mem_guarded::internal::Trivial.
Referenced by MEM_lockfree_reallocN_id(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_recallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str ) |
Definition at line 254 of file mallocn_lockfree_impl.cc.
References blender::Core, len(), MEM_lockfree_allocN_len(), MEM_lockfree_callocN(), MEM_lockfree_freeN(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), MEM_lockfree_recallocN_id(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_HAS_NONTRIVIAL_DESTRUCTOR, MEMHEAD_IS_ALIGNED, PRF_scope, report_error_on_address(), str, and mem_guarded::internal::Trivial.
Referenced by MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_reset_peak_memory | ( | void | ) |
Definition at line 587 of file mallocn_lockfree_impl.cc.
References MEM_lockfree_reset_peak_memory(), and memory_usage_peak_reset().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_reset_peak_memory(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_set_error_callback | ( | void(* | func )(const char *) | ) |
Definition at line 560 of file mallocn_lockfree_impl.cc.
References error_callback, and MEM_lockfree_set_error_callback().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_set_error_callback(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_set_memory_debug | ( | void | ) |
Definition at line 570 of file mallocn_lockfree_impl.cc.
References malloc_debug_memset, and MEM_lockfree_set_memory_debug().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), MEM_lockfree_set_memory_debug(), and MEM_use_lockfree_allocator().
| void memory_usage_block_alloc | ( | size_t | size | ) |
Definition at line 188 of file memory_usage.cc.
References get_global(), get_local_data(), memory_usage_block_alloc(), peak_update_threshold, size(), update_global_peak(), and use_local_counters.
Referenced by MEM_lockfree_callocN(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), and memory_usage_block_alloc().
| void memory_usage_block_free | ( | size_t | size | ) |
Definition at line 212 of file memory_usage.cc.
References get_global(), get_local_data(), memory_usage_block_free(), size(), and use_local_counters.
Referenced by MEM_lockfree_freeN(), and memory_usage_block_free().
| size_t memory_usage_block_num | ( | void | ) |
Definition at line 229 of file memory_usage.cc.
References get_global(), lock, and memory_usage_block_num().
Referenced by MEM_lockfree_get_memory_blocks_in_use(), and memory_usage_block_num().
| size_t memory_usage_current | ( | void | ) |
Definition at line 242 of file memory_usage.cc.
References get_global(), lock, and memory_usage_current().
Referenced by MEM_lockfree_calloc_arrayN(), MEM_lockfree_callocN(), MEM_lockfree_get_memory_in_use(), MEM_lockfree_malloc_arrayN(), mem_lockfree_malloc_arrayN_aligned(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), MEM_lockfree_printmemlist_stats(), memory_usage_current(), memory_usage_peak_reset(), and update_global_peak().
| void memory_usage_init | ( | void | ) |
Definition at line 182 of file memory_usage.cc.
References get_local_data(), and memory_usage_init().
Referenced by MEM_init_memleak_detection(), and memory_usage_init().
| size_t memory_usage_peak | ( | void | ) |
Get the approximate peak memory usage since the last call to memory_usage_peak_reset. This is approximate, because the peak usage is not updated after every allocation (see #peak_update_threshold).
In the worst case, the peak memory usage is underestimated by peak_update_threshold * #threads. After large allocations (larger than the threshold), the peak usage is always updated so those allocations will always be taken into account.
Definition at line 255 of file memory_usage.cc.
References get_global(), memory_usage_peak(), and update_global_peak().
Referenced by MEM_lockfree_get_peak_memory(), MEM_lockfree_printmemlist_stats(), and memory_usage_peak().
| void memory_usage_peak_reset | ( | void | ) |
Definition at line 262 of file memory_usage.cc.
References get_global(), memory_usage_current(), and memory_usage_peak_reset().
Referenced by MEM_lockfree_reset_peak_memory(), and memory_usage_peak_reset().
|
extern |
Definition at line 19 of file leak_detector.cc.
Referenced by MEM_guarded_freeN(), and MEM_lockfree_freeN().
|
extern |
Definition at line 18 of file leak_detector.cc.
Referenced by MEM_guarded_freeN(), and MEM_lockfree_freeN().
|
extern |
Clear the listbase of allocated memory blocks.
WARNING: This will make the whole guardedalloc system fully inconsistent. It is only indented to be called in one place: the destructor of the #MemLeakPrinter class, which is only instantiated once as a static variable by MEM_init_memleak_detection, and therefore destructed once at program exit.
Definition at line 70 of file mallocn.cc.
Referenced by MEM_use_guarded_allocator(), and MEM_use_lockfree_allocator().