diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-25 23:09:13 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-25 23:09:13 +0300 |
commit | f1ea1da5e50d4319fe96ff75bfc75f73941e5cb1 (patch) | |
tree | 7f56be421c6280eac81c75cad5dd951bef679ea8 /source/blender/blenlib | |
parent | 3b9517946a859874e85b4065fe66e0e9d36b54ce (diff) |
BLI_bitmap: add allocation from a MemArena.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_bitmap.h | 5 |
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 *), \ |