From ab4cff4f5c9ed81b11f455ff65f092d3913a2bba Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 4 Nov 2025 13:41:23 -0500 Subject: util: add BITSET_RZALLOC to complement BITSET_CALLOC for when you want a memctx in there. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Yonggang Luo Part-of: --- src/util/bitset.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/util/bitset.h') diff --git a/src/util/bitset.h b/src/util/bitset.h index 601f85ad9f8..7e10b78c2eb 100644 --- a/src/util/bitset.h +++ b/src/util/bitset.h @@ -34,6 +34,7 @@ #include #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 /** -- cgit v1.2.3