|
Blender
V2.93
|
Go to the source code of this file.
Macros | |
| #define | UNUSED(x) UNUSED_##x |
| #define | USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */ |
| #define | SIZET_FORMAT "%lu" |
| #define | SIZET_ARG(a) ((unsigned long)(a)) |
| #define | SIZET_ALIGN_4(len) ((len + 3) & ~(size_t)3) |
| #define | LIKELY(x) (x) |
| #define | UNLIKELY(x) (x) |
| #define | MEM_INLINE static inline |
| #define | IS_POW2(a) (((a) & ((a)-1)) == 0) |
| #define | MEMHEAD_ALIGN_PADDING(alignment) ((size_t)alignment - (sizeof(MemHeadAligned) % (size_t)alignment)) |
| #define | MEMHEAD_REAL_PTR(memh) ((char *)memh - MEMHEAD_ALIGN_PADDING(memh->alignment)) |
| #define | ALIGNED_MALLOC_MINIMUM_ALIGNMENT sizeof(void *) |
Variables | |
| bool | leak_detector_has_run |
| char | free_after_leak_detection_message [] |
| #define ALIGNED_MALLOC_MINIMUM_ALIGNMENT sizeof(void *) |
Definition at line 107 of file mallocn_intern.h.
| #define IS_POW2 | ( | a | ) | (((a) & ((a)-1)) == 0) |
Definition at line 92 of file mallocn_intern.h.
Definition at line 71 of file mallocn_intern.h.
| #define MEM_INLINE static inline |
Definition at line 89 of file mallocn_intern.h.
| #define MEMHEAD_ALIGN_PADDING | ( | alignment | ) | ((size_t)alignment - (sizeof(MemHeadAligned) % (size_t)alignment)) |
Definition at line 95 of file mallocn_intern.h.
| #define MEMHEAD_REAL_PTR | ( | memh | ) | ((char *)memh - MEMHEAD_ALIGN_PADDING(memh->alignment)) |
Definition at line 99 of file mallocn_intern.h.
Definition at line 65 of file mallocn_intern.h.
| #define SIZET_ARG | ( | a | ) | ((unsigned long)(a)) |
Definition at line 62 of file mallocn_intern.h.
| #define SIZET_FORMAT "%lu" |
Definition at line 61 of file mallocn_intern.h.
Definition at line 72 of file mallocn_intern.h.
Definition at line 30 of file mallocn_intern.h.
| #define USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */ |
Definition at line 34 of file mallocn_intern.h.
| void aligned_free | ( | void * | ptr | ) |
Definition at line 90 of file mallocn.c.
Referenced by MEM_lockfree_freeN(), and rem_memblock().
| void* aligned_malloc | ( | size_t | size, |
| size_t | alignment | ||
| ) |
Definition at line 68 of file mallocn.c.
References ALIGNED_MALLOC_MINIMUM_ALIGNMENT, NULL, result, and size().
Referenced by MEM_guarded_mallocN_aligned(), and MEM_lockfree_mallocN_aligned().
| void ATTR_NONNULL | ( | 3 | ) |
Iterator New.
Takes a bmesh iterator structure and fills it with the appropriate function pointers based upon its type and then calls BMeshIter_step() to return the first element of the iterator.
Given a edge and one of its vertices, returns the other vertex.
Tests whether or not the edge is part of a wire. (ie: has no faces attached to it)
Tests whether or not this edge is manifold. A manifold edge has exactly 2 faces attached to it.
Tests that the edge is manifold and that both its faces point the same way.
Tests whether or not an edge is on the boundary of a shell (has one face associated with it)
Tests whether one loop is next to another within the same face.
Check if we have a single wire edge user.
Definition at line 121 of file MEM_guardedalloc.h.
| size_t MEM_guarded_allocN_len | ( | const void * | vmemh | ) |
Definition at line 246 of file mallocn_guarded_impl.c.
References MemHead::len.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_callbackmemlist | ( | void(*)(void *) | func | ) |
Definition at line 803 of file mallocn_guarded_impl.c.
References localListBase::first, mem_lock_thread(), mem_unlock_thread(), membase, MEMNEXT, and MemHead::next.
Referenced by MEM_use_guarded_allocator().
| void* MEM_guarded_calloc_arrayN | ( | size_t | len, |
| size_t | size, | ||
| const char * | str | ||
| ) |
| void* MEM_guarded_callocN | ( | size_t | len, |
| const char * | str | ||
| ) |
Definition at line 550 of file mallocn_guarded_impl.c.
References len, make_memhead_header(), mem_in_use, NULL, 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().
| bool MEM_guarded_consistency_check | ( | void | ) |
Definition at line 223 of file mallocn_guarded_impl.c.
References check_memlist(), localListBase::last, membase, and NULL.
Referenced by MEM_use_guarded_allocator().
| void* MEM_guarded_dupallocN | ( | const void * | vmemh | ) |
Definition at line 258 of file mallocn_guarded_impl.c.
References MemHead::alignment, MemHead::len, LIKELY, MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MemHead::name, and NULL.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_freeN | ( | void * | vmemh | ) |
Definition at line 866 of file mallocn_guarded_impl.c.
References check_memlist(), free_after_leak_detection_message, leak_detector_has_run, MemHead::len, mem_lock_thread(), mem_unlock_thread(), MEMFREE, MemorY_ErroR(), MEMTAG1, MEMTAG2, MEMTAG3, MemHead::name, NULL, rem_memblock(), MemHead::tag1, MemHead::tag2, 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 1197 of file mallocn_guarded_impl.c.
References mem_lock_thread(), mem_unlock_thread(), and totblock.
Referenced by MEM_use_guarded_allocator().
| size_t MEM_guarded_get_memory_in_use | ( | void | ) |
Definition at line 1186 of file mallocn_guarded_impl.c.
References mem_in_use, mem_lock_thread(), and mem_unlock_thread().
Referenced by MEM_use_guarded_allocator().
| size_t MEM_guarded_get_peak_memory | ( | void | ) |
Definition at line 1168 of file mallocn_guarded_impl.c.
References mem_lock_thread(), mem_unlock_thread(), and peak_mem.
Referenced by MEM_use_guarded_allocator().
| void* MEM_guarded_malloc_arrayN | ( | size_t | len, |
| size_t | size, | ||
| const char * | str | ||
| ) |
| void* MEM_guarded_mallocN | ( | size_t | len, |
| const char * | str | ||
| ) |
Definition at line 449 of file mallocn_guarded_impl.c.
References len, LIKELY, make_memhead_header(), malloc_debug_memset, mem_in_use, NULL, 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().
| void* MEM_guarded_mallocN_aligned | ( | size_t | len, |
| size_t | alignment, | ||
| const char * | str | ||
| ) |
Definition at line 495 of file mallocn_guarded_impl.c.
References aligned_malloc(), MemHead::alignment, IS_POW2, len, LIKELY, make_memhead_header(), malloc_debug_memset, mem_in_use, MEMHEAD_ALIGN_PADDING, NULL, print_error(), SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, and UNLIKELY.
Referenced by MEM_guarded_dupallocN(), MEM_guarded_reallocN_id(), MEM_guarded_recallocN_id(), and MEM_use_guarded_allocator().
| const char* MEM_guarded_name_ptr | ( | void * | vmemh | ) |
Definition at line 1209 of file mallocn_guarded_impl.c.
References MemHead::name.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist | ( | void | ) |
Definition at line 857 of file mallocn_guarded_impl.c.
References MEM_guarded_printmemlist_internal().
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist_pydict | ( | void | ) |
Definition at line 861 of file mallocn_guarded_impl.c.
References MEM_guarded_printmemlist_internal().
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_printmemlist_stats | ( | void | ) |
Definition at line 622 of file mallocn_guarded_impl.c.
References Freestyle::a, MemHead::alignment, compare_len(), compare_name(), localListBase::first, free(), MemPrintBlock::items, MemHead::len, MemPrintBlock::len, mem_in_use, mem_lock_thread(), mem_unlock_thread(), membase, MEMNEXT, MemHead::name, MemPrintBlock::name, MemHead::next, NULL, peak_mem, print_error(), totblock, and UNLIKELY.
Referenced by MEM_use_guarded_allocator().
| void* MEM_guarded_reallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str | ||
| ) |
Definition at line 307 of file mallocn_guarded_impl.c.
References MemHead::alignment, MemHead::len, len, LIKELY, MEM_guarded_freeN(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MemHead::name, NULL, and str.
Referenced by MEM_use_guarded_allocator().
| void* MEM_guarded_recallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str | ||
| ) |
Definition at line 342 of file mallocn_guarded_impl.c.
References MemHead::alignment, MemHead::len, len, LIKELY, MEM_guarded_callocN(), MEM_guarded_freeN(), MEM_guarded_mallocN(), MEM_guarded_mallocN_aligned(), MemHead::name, NULL, and str.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_reset_peak_memory | ( | void | ) |
Definition at line 1179 of file mallocn_guarded_impl.c.
References mem_in_use, mem_lock_thread(), mem_unlock_thread(), and peak_mem.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_set_error_callback | ( | void(*)(const char *) | func | ) |
Definition at line 236 of file mallocn_guarded_impl.c.
References error_callback.
Referenced by MEM_use_guarded_allocator().
| void MEM_guarded_set_memory_debug | ( | void | ) |
Definition at line 241 of file mallocn_guarded_impl.c.
References malloc_debug_memset.
Referenced by MEM_use_guarded_allocator().
| size_t MEM_lockfree_allocN_len | ( | const void * | vmemh | ) |
Definition at line 93 of file mallocn_lockfree_impl.c.
References MEMHEAD_ALIGN_FLAG, and MEMHEAD_FROM_PTR.
Referenced by MEM_lockfree_dupallocN(), MEM_lockfree_freeN(), MEM_lockfree_reallocN_id(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| void MEM_lockfree_callbackmemlist | ( | void(*)(void *) | func | ) |
Definition at line 378 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
| void* MEM_lockfree_calloc_arrayN | ( | size_t | len, |
| size_t | size, | ||
| const char * | str | ||
| ) |
Referenced by MEM_use_lockfree_allocator().
| void* MEM_lockfree_callocN | ( | size_t | len, |
| const char * | str | ||
| ) |
Definition at line 230 of file mallocn_lockfree_impl.c.
References atomic_add_and_fetch_u(), atomic_add_and_fetch_z(), MemHead::len, len, LIKELY, mem_in_use, NULL, peak_mem, print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, totblock, and update_maximum().
Referenced by MEM_lockfree_calloc_arrayN(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| bool MEM_lockfree_consistency_check | ( | void | ) |
Definition at line 402 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
| void* MEM_lockfree_dupallocN | ( | const void * | vmemh | ) |
Definition at line 134 of file mallocn_lockfree_impl.c.
References MemHeadAligned::alignment, MEM_lockfree_allocN_len(), MEM_lockfree_mallocN(), MEM_lockfree_mallocN_aligned(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_IS_ALIGNED, NULL, and UNLIKELY.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_freeN | ( | void * | vmemh | ) |
Definition at line 102 of file mallocn_lockfree_impl.c.
References aligned_free(), atomic_sub_and_fetch_u(), atomic_sub_and_fetch_z(), free(), free_after_leak_detection_message, leak_detector_has_run, len, malloc_debug_memset, mem_in_use, MEM_lockfree_allocN_len(), MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_IS_ALIGNED, MEMHEAD_REAL_PTR, NULL, print_error(), totblock, 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 417 of file mallocn_lockfree_impl.c.
References totblock.
Referenced by MEM_use_lockfree_allocator().
| size_t MEM_lockfree_get_memory_in_use | ( | void | ) |
Definition at line 412 of file mallocn_lockfree_impl.c.
References mem_in_use.
Referenced by MEM_use_lockfree_allocator().
| size_t MEM_lockfree_get_peak_memory | ( | void | ) |
Definition at line 428 of file mallocn_lockfree_impl.c.
References peak_mem.
Referenced by MEM_use_lockfree_allocator().
| void* MEM_lockfree_malloc_arrayN | ( | size_t | len, |
| size_t | size, | ||
| const char * | str | ||
| ) |
Referenced by MEM_use_lockfree_allocator().
| void* MEM_lockfree_mallocN | ( | size_t | len, |
| const char * | str | ||
| ) |
Definition at line 271 of file mallocn_lockfree_impl.c.
References atomic_add_and_fetch_u(), atomic_add_and_fetch_z(), MemHead::len, len, LIKELY, malloc_debug_memset, mem_in_use, NULL, peak_mem, print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, totblock, UNLIKELY, and update_maximum().
Referenced by 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 | ||
| ) |
Definition at line 316 of file mallocn_lockfree_impl.c.
References aligned_malloc(), ALIGNED_MALLOC_MINIMUM_ALIGNMENT, MemHeadAligned::alignment, atomic_add_and_fetch_u(), atomic_add_and_fetch_z(), IS_POW2, MemHeadAligned::len, len, LIKELY, malloc_debug_memset, mem_in_use, MEMHEAD_ALIGN_FLAG, MEMHEAD_ALIGN_PADDING, NULL, peak_mem, print_error(), PTR_FROM_MEMHEAD, SIZET_ALIGN_4, SIZET_ARG, SIZET_FORMAT, str, totblock, UNLIKELY, and update_maximum().
Referenced by MEM_lockfree_dupallocN(), MEM_lockfree_reallocN_id(), MEM_lockfree_recallocN_id(), and MEM_use_lockfree_allocator().
| const char* MEM_lockfree_name_ptr | ( | void * | vmemh | ) |
Definition at line 434 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist | ( | void | ) |
Definition at line 373 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist_pydict | ( | void | ) |
Definition at line 369 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_printmemlist_stats | ( | void | ) |
Definition at line 383 of file mallocn_lockfree_impl.c.
References mem_in_use, and peak_mem.
Referenced by MEM_use_lockfree_allocator().
| void* MEM_lockfree_reallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str | ||
| ) |
Definition at line 153 of file mallocn_lockfree_impl.c.
References MemHeadAligned::alignment, 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, NULL, and str.
Referenced by MEM_use_lockfree_allocator().
| void* MEM_lockfree_recallocN_id | ( | void * | vmemh, |
| size_t | len, | ||
| const char * | str | ||
| ) |
Definition at line 189 of file mallocn_lockfree_impl.c.
References MemHeadAligned::alignment, 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, NULL, and str.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_reset_peak_memory | ( | void | ) |
Definition at line 423 of file mallocn_lockfree_impl.c.
References mem_in_use, and peak_mem.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_set_error_callback | ( | void(*)(const char *) | func | ) |
Definition at line 397 of file mallocn_lockfree_impl.c.
References error_callback.
Referenced by MEM_use_lockfree_allocator().
| void MEM_lockfree_set_memory_debug | ( | void | ) |
Definition at line 407 of file mallocn_lockfree_impl.c.
References malloc_debug_memset.
Referenced by MEM_use_lockfree_allocator().
|
extern |
Definition at line 28 of file leak_detector.cc.
Referenced by MEM_guarded_freeN(), and MEM_lockfree_freeN().
|
extern |
Definition at line 27 of file leak_detector.cc.
Referenced by MEM_guarded_freeN(), and MEM_lockfree_freeN().