limit aligned allocation to power-of-two alignment

This commit is contained in:
daan 2019-09-11 17:49:28 -07:00
parent 050e7cedf4
commit 24777f6a91
4 changed files with 26 additions and 18 deletions

View file

@ -168,7 +168,7 @@ static inline bool mi_mul_overflow(size_t count, size_t size, size_t* total) {
#endif
}
// Is `x` a power of two?
// Is `x` a power of two? (0 is considered a power of two)
static inline bool _mi_is_power_of_two(uintptr_t x) {
return ((x & (x - 1)) == 0);
}