mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-09 04:48:42 +03:00
Replace power of 2 checks with inline functions
This commit is contained in:
parent
095a87be2e
commit
e8f0375a3b
2 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue