diff options
author | daan <daanl@outlook.com> | 2019-09-09 08:12:50 -0700 |
---|---|---|
committer | daan <daanl@outlook.com> | 2019-09-09 08:12:50 -0700 |
commit | ce81af11199b05ade3a1faf9c3dcf53459ee643f (patch) | |
tree | 8f62b875775edc5ed69c82714adf37c7c328fa0f /src/alloc-posix.c | |
parent | b104e434e44da8bc4e2fc50d92d4f9a36c086c72 (diff) |
use mi_is_power_of_two when possible (pr #118)
Diffstat (limited to 'src/alloc-posix.c')
-rw-r--r-- | src/alloc-posix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/alloc-posix.c b/src/alloc-posix.c index f51aa99..f64cb1f 100644 --- a/src/alloc-posix.c +++ b/src/alloc-posix.c @@ -48,7 +48,7 @@ int mi_posix_memalign(void** p, size_t alignment, size_t size) mi_attr_noexcept // <http://man7.org/linux/man-pages/man3/posix_memalign.3.html> if (p == NULL) return EINVAL; if (alignment % sizeof(void*) != 0) return EINVAL; // natural alignment - if ((alignment & (alignment - 1)) != 0) return EINVAL; // not a power of 2 + if (!_mi_is_power_of_two(alignment)) return EINVAL; // not a power of 2 void* q = mi_malloc_aligned(size, alignment); if (q==NULL && size != 0) return ENOMEM; *p = q; |