mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
limit aligned allocation to power-of-two alignment
This commit is contained in:
parent
050e7cedf4
commit
24777f6a91
4 changed files with 26 additions and 18 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue