diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-02 03:22:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-02 03:49:03 +0300 |
commit | 4d9bf4fc6ce29f95abff6020e51ae3b78a79df89 (patch) | |
tree | 9f708dcd58b3aa86a88d52d2c6764d10652f4902 /source | |
parent | 5d9b50054c1fda1bd5875ded80548e567de53276 (diff) |
Cleanup: use dummy valgrind macros instead of ifdef's
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/BLI_memarena.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 9e084f78eee..4461e999b0b 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -41,6 +41,10 @@ #ifdef WITH_MEM_VALGRIND # include "valgrind/memcheck.h" +#else +# define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed) UNUSED_VARS(pool, rzB, is_zeroed) +# define VALGRIND_DESTROY_MEMPOOL(pool) UNUSED_VARS(pool) +# define VALGRIND_MEMPOOL_ALLOC(pool, addr, size) UNUSED_VARS(pool, addr, size) #endif struct MemBuf { @@ -75,9 +79,7 @@ MemArena *BLI_memarena_new(const size_t bufsize, const char *name) ma->align = 8; ma->name = name; -#ifdef WITH_MEM_VALGRIND VALGRIND_CREATE_MEMPOOL(ma, 0, false); -#endif return ma; } @@ -101,9 +103,8 @@ void BLI_memarena_use_align(struct MemArena *ma, const size_t align) void BLI_memarena_free(MemArena *ma) { memarena_buf_free_all(ma->bufs); -#ifdef WITH_MEM_VALGRIND + VALGRIND_DESTROY_MEMPOOL(ma); -#endif MEM_freeN(ma); } @@ -149,9 +150,7 @@ void *BLI_memarena_alloc(MemArena *ma, size_t size) ma->curbuf += size; ma->cursize -= size; -#ifdef WITH_MEM_VALGRIND VALGRIND_MEMPOOL_ALLOC(ma, ptr, size); -#endif return ptr; } @@ -197,9 +196,6 @@ void BLI_memarena_clear(MemArena *ma) } } -#ifdef WITH_MEM_VALGRIND VALGRIND_DESTROY_MEMPOOL(ma); VALGRIND_CREATE_MEMPOOL(ma, 0, false); -#endif - } |