diff --git a/src/system/runtime_loader/heap.cpp b/src/system/runtime_loader/heap.cpp index 61a815d701..bb6e8802d2 100644 --- a/src/system/runtime_loader/heap.cpp +++ b/src/system/runtime_loader/heap.cpp @@ -323,7 +323,7 @@ void * memalign(size_t alignment, size_t size) { // pseudo alignment by just upping the size - size = (size + alignment - 1) & ~alignment; + size = (size + alignment - 1) & ~(alignment - 1); return malloc(size); }