Replace power of 2 checks with inline functions

This commit is contained in:
Julian Fang 2019-07-30 01:21:02 +08:00
parent 095a87be2e
commit e8f0375a3b
2 changed files with 2 additions and 2 deletions

View file

@ -170,7 +170,7 @@ static inline uintptr_t _mi_is_power_of_two(uintptr_t x) {
}
static inline uintptr_t _mi_align_up(uintptr_t sz, size_t alignment) {
uintptr_t mask = alignment - 1;
if ((alignment & mask) == 0) { // power of two?
if (_mi_is_power_of_two(alignment)) {
return ((sz + mask) & ~mask);
}
else {