From f1ea1da5e50d4319fe96ff75bfc75f73941e5cb1 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 25 Nov 2014 21:09:13 +0100 Subject: [PATCH] BLI_bitmap: add allocation from a MemArena. --- source/blender/blenlib/BLI_bitmap.h | 5 +++++ 1 file changed, 5 insertions(+) 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 *), \