26#ifdef WITH_MEM_VALGRIND
27# include "valgrind/memcheck.h"
29# define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed) UNUSED_VARS(pool, rzB, is_zeroed)
30# define VALGRIND_DESTROY_MEMPOOL(pool) UNUSED_VARS(pool)
31# define VALGRIND_MEMPOOL_ALLOC(pool, addr, size) UNUSED_VARS(pool, addr, size)
32# define VALGRIND_MOVE_MEMPOOL(pool_a, pool_b) UNUSED_VARS(pool_a, pool_b)
55 while (mb !=
nullptr) {
106#define PADUP(num, amt) (((num) + ((amt)-1)) & ~((amt)-1))
169 memset(ptr, 0,
size);
182 if (ma_src->
bufs ==
nullptr) {
195 if (ma_dst->
bufs->
next !=
nullptr) {
199 while (mb_src->
next) {
200 mb_src = mb_src->
next;
207 ma_src->
bufs =
nullptr;
228 const size_t curbuf_used = size_t(curbuf_prev - ma->
curbuf);
232 memset(ma->
curbuf, 0, curbuf_used);
#define BLI_asan_unpoison(addr, size)
#define BLI_asan_poison(addr, size)
static void memarena_curbuf_align(MemArena *ma)
#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)
void BLI_memarena_merge(MemArena *ma_dst, MemArena *ma_src)
static void memarena_buf_free_all(MemBuf *mb)
#define VALGRIND_MOVE_MEMPOOL(pool_a, pool_b)
#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed)
#define VALGRIND_DESTROY_MEMPOOL(pool)
MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
void * BLI_memarena_calloc(MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
void BLI_memarena_free(MemArena *ma) ATTR_NONNULL(1)
void * BLI_memarena_alloc(MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
void BLI_memarena_clear(MemArena *ma) ATTR_NONNULL(1)
void BLI_memarena_use_malloc(MemArena *ma) ATTR_NONNULL(1)
void BLI_memarena_use_align(MemArena *ma, size_t align) ATTR_NONNULL(1)
void BLI_memarena_use_calloc(MemArena *ma) ATTR_NONNULL(1)
Read Guarded memory(de)allocation.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void * MEM_mallocN(size_t len, const char *str)
size_t(*) MEM_allocN_len(const void *vmemh)
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)