mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-22 16:10:36 +02:00
util: add BITSET_RZALLOC
to complement BITSET_CALLOC for when you want a memctx in there. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38245>
This commit is contained in:
parent
18eacdda3e
commit
ab4cff4f5c
1 changed files with 7 additions and 0 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include <stdlib.h>
|
||||
#include "util/bitscan.h"
|
||||
#include "util/macros.h"
|
||||
#include "ralloc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* generic bitset implementation
|
||||
|
|
@ -495,6 +496,12 @@ BITSET_CALLOC(unsigned size)
|
|||
return (BITSET_WORD *) calloc(BITSET_WORDS(size), sizeof(BITSET_WORD));
|
||||
}
|
||||
|
||||
static inline BITSET_WORD *
|
||||
BITSET_RZALLOC(const void *memctx, unsigned size)
|
||||
{
|
||||
return (BITSET_WORD *)rzalloc_size(memctx, BITSET_BYTES(size));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue