summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d6d1d8e)
size_t is apparently not an unsigned long on 32 bit, which is what
rounddown_pow_of_two() returns.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
for (i = 0; i < 10; i++) {
if (size) {
for (i = 0; i < 10; i++) {
if (size) {
- size_t alignment = min(rounddown_pow_of_two(size), (size_t)PAGE_SIZE);
+ size_t alignment = min_t(size_t, PAGE_SIZE,
+ rounddown_pow_of_two(size));
alignment = max(sizeof(void *), alignment);
if (posix_memalign(&p, alignment, size))
p = NULL;
alignment = max(sizeof(void *), alignment);
if (posix_memalign(&p, alignment, size))
p = NULL;