Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-11-25 23:09:13 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2014-11-25 23:09:13 +0300
commitf1ea1da5e50d4319fe96ff75bfc75f73941e5cb1 (patch)
tree7f56be421c6280eac81c75cad5dd951bef679ea8 /source
parent3b9517946a859874e85b4065fe66e0e9d36b54ce (diff)
BLI_bitmap: add allocation from a MemArena.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/BLI_bitmap.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index e4c625439d3..e9a828c678c 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 *), \