am 73c963e4: Fix BIONIC_ROUND_UP_POWER_OF_2 for 64 bit.
* commit '73c963e4c5bf111df3abe9ad7eac98a918b88bb3': Fix BIONIC_ROUND_UP_POWER_OF_2 for 64 bit.
This commit is contained in:
commit
cdf48775d4
@ -37,6 +37,8 @@
|
||||
(((value) + (alignment) - 1) & ~((alignment) - 1))
|
||||
|
||||
#define BIONIC_ROUND_UP_POWER_OF_2(value) \
|
||||
(1UL << (sizeof(value) * 8 - 1 - __builtin_clz(value)))
|
||||
(sizeof(value) == 8) \
|
||||
? (1UL << (64 - __builtin_clzl(static_cast<unsigned long>(value)))) \
|
||||
: (1UL << (32 - __builtin_clz(static_cast<unsigned int>(value))))
|
||||
|
||||
#endif // _BIONIC_MACROS_H_
|
||||
|
Loading…
x
Reference in New Issue
Block a user