@@ -191,6 +191,10 @@ is_pow2(uintmax_t x)
#define RDP2_4(X) (RDP2_5(X) | (RDP2_5(X) >> 2))
#define RDP2_5(X) ( (X) | ( (X) >> 1))
+/* Macros for sizing bitmaps */
+#define BITMAP_ULONG_BITS (sizeof(unsigned long) * CHAR_BIT)
+#define BITMAP_N_LONGS(N_BITS) DIV_ROUND_UP(N_BITS, BITMAP_ULONG_BITS)
+
/* Given ATTR, and TYPE, cast the ATTR to TYPE by first casting ATTR to
* (void *). This is to suppress the alignment warning issued by clang. */
#define ALIGNED_CAST(TYPE, ATTR) ((TYPE) (void *) (ATTR))
@@ -21,8 +21,6 @@
#include <stdlib.h>
#include "util.h"
-#define BITMAP_ULONG_BITS (sizeof(unsigned long) * CHAR_BIT)
-
static inline unsigned long *
bitmap_unit__(const unsigned long *bitmap, size_t offset)
{
@@ -35,8 +33,6 @@ bitmap_bit__(size_t offset)
return 1UL << (offset % BITMAP_ULONG_BITS);
}
-#define BITMAP_N_LONGS(N_BITS) DIV_ROUND_UP(N_BITS, BITMAP_ULONG_BITS)
-
static inline size_t
bitmap_n_longs(size_t n_bits)
{