Blender
V3.3
|
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 "%zu" |
#define | SIZET_ARG(a) ((size_t)(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 [] |
Definition at line 87 of file mallocn_intern.h.
#define IS_POW2 | ( | a | ) | (((a) & ((a)-1)) == 0) |
Definition at line 72 of file mallocn_intern.h.
Definition at line 51 of file mallocn_intern.h.
#define MEM_INLINE static inline |
Definition at line 69 of file mallocn_intern.h.
#define MEMHEAD_ALIGN_PADDING | ( | alignment | ) | ((size_t)alignment - (sizeof(MemHeadAligned) % (size_t)alignment)) |
Definition at line 75 of file mallocn_intern.h.
#define MEMHEAD_REAL_PTR | ( | memh | ) | ((char *)memh - MEMHEAD_ALIGN_PADDING(memh->alignment)) |
Definition at line 79 of file mallocn_intern.h.
Definition at line 45 of file mallocn_intern.h.
#define SIZET_ARG | ( | a | ) | ((size_t)(a)) |
Definition at line 43 of file mallocn_intern.h.
#define SIZET_FORMAT "%zu" |
Definition at line 42 of file mallocn_intern.h.
Definition at line 52 of file mallocn_intern.h.
Definition at line 14 of file mallocn_intern.h.
#define USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */ |
Definition at line 18 of file mallocn_intern.h.
Definition at line 76 of file mallocn.c.
Referenced by MEM_lockfree_freeN(), and rem_memblock().
void* aligned_malloc | ( | size_t | size, |
size_t | alignment | ||
) |
Definition at line 54 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 106 of file MEM_guardedalloc.h.
size_t MEM_guarded_allocN_len | ( | const void * | vmemh | ) |
Definition at line 229 of file mallocn_guarded_impl.c.
References MemHead::len.
Referenced by MEM_use_guarded_allocator().
Definition at line 786 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 533 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().
Definition at line 206 of file mallocn_guarded_impl.c.
References check_memlist(), localListBase::last, membase, and NULL.
Referenced by MEM_use_guarded_allocator().
Definition at line 241 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().
Definition at line 849 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 1180 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 1169 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 1151 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 432 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 478 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 1192 of file mallocn_guarded_impl.c.
References MemHead::name.
Referenced by MEM_use_guarded_allocator().
Definition at line 840 of file mallocn_guarded_impl.c.
References MEM_guarded_printmemlist_internal().
Referenced by MEM_use_guarded_allocator().
Definition at line 844 of file mallocn_guarded_impl.c.
References MEM_guarded_printmemlist_internal().
Referenced by MEM_use_guarded_allocator().
Definition at line 605 of file mallocn_guarded_impl.c.
References Freestyle::a, MemHead::alignment, usdtokens::b(), 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().
Definition at line 290 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().
Definition at line 325 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().
Definition at line 1162 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().
Definition at line 219 of file mallocn_guarded_impl.c.
References error_callback.
Referenced by MEM_use_guarded_allocator().
Definition at line 224 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 80 of file mallocn_lockfree_impl.c.
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().
Definition at line 365 of file mallocn_lockfree_impl.c.
References void.
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 217 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().
Definition at line 389 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
Definition at line 121 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().
Definition at line 89 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, MEMHEAD_ALIGNED_FROM_PTR, MEMHEAD_FROM_PTR, MEMHEAD_IS_ALIGNED, MEMHEAD_LEN, 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 404 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 399 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 415 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 258 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 303 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 421 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
Definition at line 360 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
Definition at line 356 of file mallocn_lockfree_impl.c.
Referenced by MEM_use_lockfree_allocator().
Definition at line 370 of file mallocn_lockfree_impl.c.
References mem_in_use, and peak_mem.
Referenced by MEM_use_lockfree_allocator().
Definition at line 140 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().
Definition at line 176 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().
Definition at line 410 of file mallocn_lockfree_impl.c.
References mem_in_use, and peak_mem.
Referenced by MEM_use_lockfree_allocator().
Definition at line 384 of file mallocn_lockfree_impl.c.
References error_callback.
Referenced by MEM_use_lockfree_allocator().
Definition at line 394 of file mallocn_lockfree_impl.c.
References malloc_debug_memset.
Referenced by MEM_use_lockfree_allocator().
|
extern |
Definition at line 14 of file leak_detector.cc.
Referenced by MEM_guarded_freeN(), and MEM_lockfree_freeN().
|
extern |
Definition at line 13 of file leak_detector.cc.
Referenced by MEM_guarded_freeN(), and MEM_lockfree_freeN().