|
Blender V5.0
|
Go to the source code of this file.
Macros | |
| #define | UNUSED(x) |
| #define | USE_MALLOC_USABLE_SIZE /* internal, when we have 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 83 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 72 of file mallocn_intern.hh.
Referenced by MEM_guarded_mallocN_aligned(), and MEM_lockfree_mallocN_aligned().
| #define LIKELY | ( | x | ) |
Definition at line 52 of file mallocn_intern.hh.
| #define MEM_INLINE static inline |
Definition at line 69 of file mallocn_intern.hh.
Referenced by MEM_size_safe_multiply(), and MEM_trigger_error_on_memory_block().
| #define MEMHEAD_ALIGN_PADDING | ( | alignment | ) |
Definition at line 75 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 79 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 53 of file mallocn_intern.hh.
| #define UNUSED | ( | x | ) |
Definition at line 16 of file mallocn_intern.hh.
| #define USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */ |
Definition at line 20 of file mallocn_intern.hh.
| void aligned_free | ( | void * | ptr | ) |
Definition at line 104 of file mallocn.cc.
Referenced by MEM_lockfree_freeN(), and rem_memblock().
| void * aligned_malloc | ( | size_t | size, |
| size_t | alignment ) |
Definition at line 82 of file mallocn.cc.
References ALIGNED_MALLOC_MINIMUM_ALIGNMENT, assert, result, and size().
Referenced by 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 313 of file mallocn_guarded_impl.cc.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_callbackmemlist | ( | void(* | func )(void *) | ) |
Definition at line 971 of file mallocn_guarded_impl.cc.
References mem_lock_thread(), mem_unlock_thread(), membase, and MEMNEXT.
Referenced by 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_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 666 of file mallocn_guarded_impl.cc.
References mem_guarded::internal::ALLOC_FREE, len, make_memhead_header(), mem_in_use, print_error(), SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, and str.
Referenced by MEM_guarded_calloc_arrayN(), MEM_guarded_recallocN_id(), and MEM_use_guarded_allocator().
| void mem_guarded_clearmemlist | ( | void | ) |
Definition at line 1034 of file mallocn_guarded_impl.cc.
References membase.
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| bool MEM_guarded_consistency_check | ( | void | ) |
Definition at line 290 of file mallocn_guarded_impl.cc.
References check_memlist(), and membase.
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void * MEM_guarded_dupallocN | ( | const void * | vmemh | ) |
Definition at line 325 of file mallocn_guarded_impl.cc.
References mem_guarded::internal::ALLOC_FREE, LIKELY, MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEMHEAD_FLAG_FROM_CPP_NEW, name, and report_error_on_address().
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_freeN | ( | void * | vmemh, |
| mem_guarded::internal::AllocationType | allocation_type ) |
Definition at line 1039 of file mallocn_guarded_impl.cc.
References check_memlist(), free_after_leak_detection_message, leak_detector_has_run, mem_lock_thread(), mem_unlock_thread(), MEMFREE, MEMHEAD_FLAG_FROM_CPP_NEW, MemorY_ErroR(), MEMTAG1, MEMTAG2, MEMTAG3, name, mem_guarded::internal::NEW_DELETE, rem_memblock(), report_error_on_address(), MemTail::tag3, and totblock.
Referenced by MEM_guarded_reallocN_id(), MEM_guarded_recallocN_id(), and MEM_use_guarded_allocator().
| unsigned int MEM_guarded_get_memory_blocks_in_use | ( | void | ) |
Definition at line 1384 of file mallocn_guarded_impl.cc.
References mem_lock_thread(), mem_unlock_thread(), and totblock.
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| size_t MEM_guarded_get_memory_in_use | ( | void | ) |
Definition at line 1373 of file mallocn_guarded_impl.cc.
References mem_in_use, mem_lock_thread(), and mem_unlock_thread().
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| size_t MEM_guarded_get_peak_memory | ( | void | ) |
Definition at line 1355 of file mallocn_guarded_impl.cc.
References mem_lock_thread(), mem_unlock_thread(), and peak_mem.
Referenced by MEM_guarded_calloc_arrayN_aligned(), 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 532 of file mallocn_guarded_impl.cc.
References mem_guarded::internal::ALLOC_FREE, len, LIKELY, make_memhead_header(), malloc_debug_memset, mem_in_use, print_error(), SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, and UNLIKELY.
Referenced by MEM_guarded_calloc_arrayN(), MEM_guarded_dupallocN(), MEM_guarded_malloc_arrayN(), 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::AllocationType | allocation_type ) |
Definition at line 593 of file mallocn_guarded_impl.cc.
References aligned_malloc(), ALIGNED_MALLOC_MINIMUM_ALIGNMENT, assert, IS_POW2, len, LIKELY, make_memhead_header(), malloc_debug_memset, mem_in_use, MEMHEAD_ALIGN_PADDING, print_error(), SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, and UNLIKELY.
Referenced by MEM_guarded_dupallocN(), MEM_guarded_malloc_arrayN(), MEM_guarded_reallocN_id(), MEM_guarded_recallocN_id(), and MEM_use_guarded_allocator().
| const char * MEM_guarded_name_ptr | ( | void * | vmemh | ) |
Definition at line 1396 of file mallocn_guarded_impl.cc.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_name_ptr_set | ( | void * | vmemh, |
| const char * | str ) |
Definition at line 1407 of file mallocn_guarded_impl.cc.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist | ( | void | ) |
Definition at line 1026 of file mallocn_guarded_impl.cc.
References MEM_guarded_printmemlist_internal().
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist_pydict | ( | void | ) |
Definition at line 1030 of file mallocn_guarded_impl.cc.
References MEM_guarded_printmemlist_internal().
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist_stats | ( | void | ) |
Definition at line 787 of file mallocn_guarded_impl.cc.
References b, compare_len(), compare_name(), free(), MemPrintBlock::items, MemPrintBlock::len, mem_in_use, mem_lock_thread(), mem_unlock_thread(), membase, MEMNEXT, MemPrintBlock::name, name, peak_mem, print_error(), printf, totblock, and UNLIKELY.
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void * MEM_guarded_reallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str ) |
Definition at line 385 of file mallocn_guarded_impl.cc.
References mem_guarded::internal::ALLOC_FREE, len, LIKELY, MEM_guarded_freeN(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEMHEAD_FLAG_FROM_CPP_NEW, report_error_on_address(), and str.
Referenced by 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 mem_guarded::internal::ALLOC_FREE, len, LIKELY, MEM_guarded_callocN(), MEM_guarded_freeN(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MEMHEAD_FLAG_FROM_CPP_NEW, report_error_on_address(), and str.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_reset_peak_memory | ( | void | ) |
Definition at line 1366 of file mallocn_guarded_impl.cc.
References mem_in_use, mem_lock_thread(), mem_unlock_thread(), and peak_mem.
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void MEM_guarded_set_error_callback | ( | void(* | func )(const char *) | ) |
Definition at line 303 of file mallocn_guarded_impl.cc.
References error_callback.
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| void MEM_guarded_set_memory_debug | ( | void | ) |
Definition at line 308 of file mallocn_guarded_impl.cc.
References malloc_debug_memset.
Referenced by MEM_guarded_calloc_arrayN_aligned(), and MEM_use_guarded_allocator().
| size_t MEM_lockfree_allocN_len | ( | const void * | vmemh | ) |
Definition at line 138 of file mallocn_lockfree_impl.cc.
References LIKELY, MEMHEAD_FROM_PTR, and MEMHEAD_LEN.
Referenced by 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 524 of file mallocn_lockfree_impl.cc.
Referenced by 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(), 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_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_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(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_callocN | ( | size_t | len, |
| const char * | str ) |
Definition at line 298 of file mallocn_lockfree_impl.cc.
References len, LIKELY, memory_usage_block_alloc(), memory_usage_current(), print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, and str.
Referenced by MEM_lockfree_calloc_arrayN(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| void mem_lockfree_clearmemlist | ( | void | ) |
Definition at line 520 of file mallocn_lockfree_impl.cc.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| bool MEM_lockfree_consistency_check | ( | void | ) |
Definition at line 548 of file mallocn_lockfree_impl.cc.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_dupallocN | ( | const void * | vmemh | ) |
Definition at line 181 of file mallocn_lockfree_impl.cc.
References mem_guarded::internal::ALLOC_FREE, MEM_lockfree_allocN_len(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_IS_ALIGNED, MEMHEAD_IS_FROM_CPP_NEW, report_error_on_address(), and UNLIKELY.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_freeN | ( | void * | vmemh, |
| mem_guarded::internal::AllocationType | allocation_type ) |
Definition at line 147 of file mallocn_lockfree_impl.cc.
References aligned_free(), free(), free_after_leak_detection_message, leak_detector_has_run, len, malloc_debug_memset, MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_IS_ALIGNED, MEMHEAD_IS_FROM_CPP_NEW, MEMHEAD_LEN, MEMHEAD_REAL_PTR, memory_usage_block_free(), mem_guarded::internal::NEW_DELETE, print_error(), report_error_on_address(), and UNLIKELY.
Referenced by 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 563 of file mallocn_lockfree_impl.cc.
References memory_usage_block_num().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| size_t MEM_lockfree_get_memory_in_use | ( | void | ) |
Definition at line 558 of file mallocn_lockfree_impl.cc.
References memory_usage_current().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| size_t MEM_lockfree_get_peak_memory | ( | void | ) |
Definition at line 575 of file mallocn_lockfree_impl.cc.
References memory_usage_peak().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), 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(), 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(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_mallocN | ( | size_t | len, |
| const char * | str ) |
Definition at line 337 of file mallocn_lockfree_impl.cc.
References len, LIKELY, malloc_debug_memset, memory_usage_block_alloc(), memory_usage_current(), print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, and UNLIKELY.
Referenced by ATTR_NONNULL(), MEM_lockfree_dupallocN(), MEM_lockfree_malloc_arrayN(), 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::AllocationType | allocation_type ) |
Definition at line 394 of file mallocn_lockfree_impl.cc.
References aligned_malloc(), ALIGNED_MALLOC_MINIMUM_ALIGNMENT, assert, IS_POW2, len, LIKELY, malloc_debug_memset, MEMHEAD_ALIGN_PADDING, MEMHEAD_FLAG_ALIGN, MEMHEAD_FLAG_FROM_CPP_NEW, memory_usage_block_alloc(), memory_usage_current(), mem_guarded::internal::NEW_DELETE, print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, and UNLIKELY.
Referenced by MEM_lockfree_dupallocN(), MEM_lockfree_malloc_arrayN(), MEM_lockfree_reallocN_id(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| const char * MEM_lockfree_name_ptr | ( | void * | vmemh | ) |
Definition at line 581 of file mallocn_lockfree_impl.cc.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_name_ptr_set | ( | void * | vmemh, |
| const char * | str ) |
Definition at line 590 of file mallocn_lockfree_impl.cc.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist | ( | void | ) |
Definition at line 518 of file mallocn_lockfree_impl.cc.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist_pydict | ( | void | ) |
Definition at line 516 of file mallocn_lockfree_impl.cc.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist_stats | ( | void | ) |
Definition at line 529 of file mallocn_lockfree_impl.cc.
References memory_usage_current(), memory_usage_peak(), and printf.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void * MEM_lockfree_reallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str ) |
Definition at line 207 of file mallocn_lockfree_impl.cc.
References mem_guarded::internal::ALLOC_FREE, len, LIKELY, MEM_lockfree_allocN_len(), MEM_lockfree_freeN(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_IS_ALIGNED, MEMHEAD_IS_FROM_CPP_NEW, report_error_on_address(), and str.
Referenced by MEM_use_lockfree_allocator().
| void * MEM_lockfree_recallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str ) |
Definition at line 250 of file mallocn_lockfree_impl.cc.
References mem_guarded::internal::ALLOC_FREE, len, LIKELY, MEM_lockfree_allocN_len(), MEM_lockfree_callocN(), MEM_lockfree_freeN(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_IS_ALIGNED, MEMHEAD_IS_FROM_CPP_NEW, report_error_on_address(), and str.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_reset_peak_memory | ( | void | ) |
Definition at line 570 of file mallocn_lockfree_impl.cc.
References memory_usage_peak_reset().
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_set_error_callback | ( | void(* | func )(const char *) | ) |
Definition at line 543 of file mallocn_lockfree_impl.cc.
References error_callback.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_set_memory_debug | ( | void | ) |
Definition at line 553 of file mallocn_lockfree_impl.cc.
References malloc_debug_memset.
Referenced by MEM_lockfree_calloc_arrayN_aligned(), 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(), LIKELY, peak_update_threshold, size(), update_global_peak(), and use_local_counters.
Referenced by MEM_lockfree_callocN(), MEM_lockfree_mallocN(), and MEM_lockfree_mallocN_aligned().
| void memory_usage_block_free | ( | size_t | size | ) |
Definition at line 212 of file memory_usage.cc.
References get_global(), get_local_data(), LIKELY, size(), and use_local_counters.
Referenced by MEM_lockfree_freeN().
| size_t memory_usage_block_num | ( | void | ) |
Definition at line 229 of file memory_usage.cc.
References get_global(), and lock.
Referenced by MEM_lockfree_get_memory_blocks_in_use().
| size_t memory_usage_current | ( | void | ) |
Definition at line 242 of file memory_usage.cc.
References get_global(), lock, and mem_in_use.
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_peak_reset(), and update_global_peak().
| void memory_usage_init | ( | void | ) |
Definition at line 182 of file memory_usage.cc.
References get_local_data().
Referenced by MEM_init_memleak_detection().
| 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(), and update_global_peak().
Referenced by MEM_lockfree_get_peak_memory(), and MEM_lockfree_printmemlist_stats().
| void memory_usage_peak_reset | ( | void | ) |
Definition at line 262 of file memory_usage.cc.
References get_global(), and memory_usage_current().
Referenced by MEM_lockfree_reset_peak_memory().
|
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 75 of file mallocn.cc.
Referenced by MEM_use_guarded_allocator(), and MEM_use_lockfree_allocator().