From f71ccde8330b8317d3a72947cf5f8689ac1ef289 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 24 Dec 2022 11:49:12 +0100 Subject: [PATCH] Add an overload for aligned deletes which just calls the normal operator delete --- luna/include/luna/Alloc.h | 1 + luna/src/Alloc.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/luna/include/luna/Alloc.h b/luna/include/luna/Alloc.h index 562ac483..921dbe3d 100644 --- a/luna/include/luna/Alloc.h +++ b/luna/include/luna/Alloc.h @@ -20,6 +20,7 @@ void raw_free(void*); void* operator new(usize size, const std::nothrow_t&) noexcept; void* operator new[](usize size, const std::nothrow_t&) noexcept; +void operator delete(void* ptr, usize size, std::align_val_t alignment) noexcept; template [[nodiscard]] Result make(Args... args) { diff --git a/luna/src/Alloc.cpp b/luna/src/Alloc.cpp index 57ec3eb7..d97a3434 100644 --- a/luna/src/Alloc.cpp +++ b/luna/src/Alloc.cpp @@ -22,4 +22,9 @@ void raw_free(void* ptr) #else return free(ptr); #endif +} + +void operator delete(void* ptr, usize size, std::align_val_t) noexcept +{ + operator delete(ptr, size); } \ No newline at end of file