@@ -49,7 +49,7 @@ namespace snmalloc
4949 template <size_t alignment>
5050 static inline bool is_aligned_block (void * p, size_t size)
5151 {
52- static_assert (bits::next_pow2_const (alignment) == alignment );
52+ static_assert (bits::is_pow2 (alignment));
5353
5454 return ((address_cast (p) | size) & (alignment - 1 )) == 0 ;
5555 }
@@ -62,7 +62,7 @@ namespace snmalloc
6262 SNMALLOC_FAST_PATH T* pointer_align_down (void * p)
6363 {
6464 static_assert (alignment > 0 );
65- static_assert (bits::next_pow2_const (alignment) == alignment );
65+ static_assert (bits::is_pow2 (alignment));
6666 if constexpr (alignment == 1 )
6767 return static_cast <T*>(p);
6868 else
@@ -84,7 +84,7 @@ namespace snmalloc
8484 inline T* pointer_align_up (void * p)
8585 {
8686 static_assert (alignment > 0 );
87- static_assert (bits::next_pow2_const (alignment) == alignment );
87+ static_assert (bits::is_pow2 (alignment));
8888 if constexpr (alignment == 1 )
8989 return static_cast <T*>(p);
9090 else
@@ -106,7 +106,7 @@ namespace snmalloc
106106 SNMALLOC_FAST_PATH T* pointer_align_down (void * p, size_t alignment)
107107 {
108108 SNMALLOC_ASSERT (alignment > 0 );
109- SNMALLOC_ASSERT (bits::next_pow2 (alignment) == alignment );
109+ SNMALLOC_ASSERT (bits::is_pow2 (alignment));
110110#if __has_builtin(__builtin_align_down)
111111 return static_cast <T*>(__builtin_align_down (p, alignment));
112112#else
@@ -123,7 +123,7 @@ namespace snmalloc
123123 inline T* pointer_align_up (void * p, size_t alignment)
124124 {
125125 SNMALLOC_ASSERT (alignment > 0 );
126- SNMALLOC_ASSERT (bits::next_pow2 (alignment) == alignment );
126+ SNMALLOC_ASSERT (bits::is_pow2 (alignment));
127127#if __has_builtin(__builtin_align_up)
128128 return static_cast <T*>(__builtin_align_up (p, alignment));
129129#else
0 commit comments