BLI_bitmap: add allocation from a MemArena.

This commit is contained in:
Bastien Montagne 2014-11-25 21:09:13 +01:00
parent 3b9517946a
commit f1ea1da5e5
Notes: blender-bot 2023-02-14 09:47:10 +01:00
Referenced by issue #42971, emitting particles using a dynamic paint weightmap
Referenced by issue #42972, Crash when using Lasso select in Graph Editor
Referenced by issue #42729, Blender wont start correctly using Symlinks
1 changed files with 5 additions and 0 deletions

View File

@ -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 *), \