diff --git a/lci/sys/lciu_malloc.h b/lci/sys/lciu_malloc.h index 2d0d7ceb..a766c56f 100644 --- a/lci/sys/lciu_malloc.h +++ b/lci/sys/lciu_malloc.h @@ -11,10 +11,12 @@ static inline void* LCIU_memalign(size_t alignment, size_t size) { void* p_ptr; int ret = posix_memalign(&p_ptr, alignment, size); - LCI_Assert( - ret == 0, "posix_memalign(%lu, %lu) returned %d (Free memory %lu/%lu)\n", - alignment, size, ret, sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGESIZE), - sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE)); + if (ret != 0) { + LCI_Assert( + false, "posix_memalign(%lu, %lu) returned %d (Free memory %lu/%lu)\n", + alignment, size, ret, sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGESIZE), + sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE)); + } return p_ptr; } static inline void LCIU_free(void* ptr) { free(ptr); }