[Bf-blender-cvs] [f1ea1da] master: BLI_bitmap: add allocation from a MemArena.

Bastien Montagne noreply at git.blender.org
Tue Nov 25 21:09:36 CET 2014


Commit: f1ea1da5e50d4319fe96ff75bfc75f73941e5cb1
Author: Bastien Montagne
Date:   Tue Nov 25 21:09:13 2014 +0100
Branches: master
https://developer.blender.org/rBf1ea1da5e50d4319fe96ff75bfc75f73941e5cb1

BLI_bitmap: add allocation from a MemArena.

===================================================================

M	source/blender/blenlib/BLI_bitmap.h

===================================================================

diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index e4c6254..e9a828c 100644
--- a/source/blender/blenlib/BLI_bitmap.h
+++ b/source/blender/blenlib/BLI_bitmap.h
@@ -59,6 +59,11 @@ typedef unsigned int BLI_bitmap;
 #define BLI_BITMAP_NEW_ALLOCA(_tot) \
 	((BLI_bitmap *)memset(alloca(BLI_BITMAP_SIZE(_tot)), 0, BLI_BITMAP_SIZE(_tot)))
 
+/* Allocate using given MemArena */
+#define BLI_BITMAP_NEW_MEMARENA(_mem, _tot) \
+	(CHECK_TYPE_INLINE(_mem, MemArena *), \
+	 ((BLI_bitmap *)BLI_memarena_calloc(_mem, BLI_BITMAP_SIZE(_tot))))
+
 /* get the value of a single bit at '_index' */
 #define BLI_BITMAP_TEST(_bitmap, _index) \
 	(CHECK_TYPE_INLINE(_bitmap, BLI_bitmap *), \




More information about the Bf-blender-cvs mailing list