Commit: 4d9bf4fc6ce29f95abff6020e51ae3b78a79df89
Author: Campbell Barton
Date: Sat Mar 2 11:22:29 2019 +1100
Branches: master
https://developer.blender.org/rB4d9bf4fc6ce29f95abff6020e51ae3b78a79df89
Cleanup: use dummy valgrind macros instead of ifdef's
===================================================================
M source/blender/blenlib/intern/BLI_memarena.c
===================================================================
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
-
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs