Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions junction/new_override.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ __always_inline void *do_new_aligned(size_t size, std::align_val_t a) {
auto align = static_cast<size_t>(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
Expand Down