diff --git a/junction/new_override.cc b/junction/new_override.cc index 8122d597..cc3660c0 100644 --- a/junction/new_override.cc +++ b/junction/new_override.cc @@ -43,14 +43,14 @@ __always_inline void *do_new_aligned(size_t size, std::align_val_t a) { auto align = static_cast(a); // Handle the case where the runtime is not initialized - if (unlikely(!runtime.ready)) return std::aligned_alloc(size, align); + if (unlikely(!runtime.ready)) return std::aligned_alloc(align, size); size_t aligned = AlignUp(size, align); // Handle the case where the object being allocated is large if (unlikely(aligned >= kMaxAllocSize)) { rt::RuntimeLibcGuard guard; - return std::aligned_alloc(size, align); + return std::aligned_alloc(align, size); } // Hot path: Handle typical allocations using the runtime