From 96e6fb22cd702332e7386ff5abdba12502d108fa Mon Sep 17 00:00:00 2001 From: _Redstone_c_ Date: Sun, 15 Jan 2023 21:57:16 +0800 Subject: [PATCH] fix(memory): fix alignment of operator new to __STDCPP_DEFAULT_NEW_ALIGNMENT__ --- Redcraft.Utility/Source/Public/Memory/Memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Redcraft.Utility/Source/Public/Memory/Memory.h b/Redcraft.Utility/Source/Public/Memory/Memory.h index 5404e7b..389383f 100644 --- a/Redcraft.Utility/Source/Public/Memory/Memory.h +++ b/Redcraft.Utility/Source/Public/Memory/Memory.h @@ -299,7 +299,7 @@ NAMESPACE_REDCRAFT_END // The global overload operators new/delete do not cross .dll boundaries, and the macros should be placed in the .cpp of each module. #define REPLACEMENT_OPERATOR_NEW_AND_DELETE \ - NODISCARD void* operator new(std::size_t Count) { return NAMESPACE_REDCRAFT::Memory::Malloc(Count); } \ + NODISCARD void* operator new(std::size_t Count) { return NAMESPACE_REDCRAFT::Memory::Malloc(Count, __STDCPP_DEFAULT_NEW_ALIGNMENT__); } \ NODISCARD void* operator new(std::size_t Count, std::align_val_t Alignment) { return NAMESPACE_REDCRAFT::Memory::Malloc(Count, static_cast(Alignment)); } \ void operator delete(void* Ptr) noexcept { NAMESPACE_REDCRAFT::Memory::Free(Ptr); } \ void operator delete(void* Ptr, std::align_val_t Alignment) noexcept { NAMESPACE_REDCRAFT::Memory::Free(Ptr); }