diff --git a/Source/Engine/Platform/Win32/Win32Platform.cpp b/Source/Engine/Platform/Win32/Win32Platform.cpp index 129ff4249..9efd32cea 100644 --- a/Source/Engine/Platform/Win32/Win32Platform.cpp +++ b/Source/Engine/Platform/Win32/Win32Platform.cpp @@ -11,12 +11,12 @@ #include "Engine/Core/Math/Math.h" #include "IncludeWindowsHeaders.h" #include "Engine/Core/Collections/HashFunctions.h" - #include #include #include #include #include +#include #pragma comment(lib, "Iphlpapi.lib") namespace @@ -299,6 +299,24 @@ void Win32Platform::AtomicStore(int64 volatile* dst, int64 value) InterlockedExchange64(dst, value); } +void Win32Platform::Prefetch(void const* ptr) +{ + _mm_prefetch((char const*)ptr, _MM_HINT_T0); +} + +void* Win32Platform::Allocate(uint64 size, uint64 alignment) +{ +#if COMPILE_WITH_PROFILER + TrackAllocation(size); +#endif + return _aligned_malloc((size_t)size, (size_t)alignment); +} + +void Win32Platform::Free(void* ptr) +{ + _aligned_free(ptr); +} + bool Win32Platform::Is64BitPlatform() { #ifdef PLATFORM_64BITS diff --git a/Source/Engine/Platform/Win32/Win32Platform.h b/Source/Engine/Platform/Win32/Win32Platform.h index b6a4cdd62..f8fb1baca 100644 --- a/Source/Engine/Platform/Win32/Win32Platform.h +++ b/Source/Engine/Platform/Win32/Win32Platform.h @@ -5,7 +5,6 @@ #if PLATFORM_WIN32 #include "Engine/Platform/Base/PlatformBase.h" -#include /// /// The Win32 platform implementation and application management utilities. @@ -27,21 +26,9 @@ public: static int64 AtomicRead(int64 volatile* dst); static void AtomicStore(int32 volatile* dst, int32 value); static void AtomicStore(int64 volatile* dst, int64 value); - FORCE_INLINE static void Prefetch(void const* ptr) - { - _mm_prefetch((char const*)ptr, _MM_HINT_T0); - } - FORCE_INLINE static void* Allocate(uint64 size, uint64 alignment) - { -#if COMPILE_WITH_PROFILER - TrackAllocation(size); -#endif - return _aligned_malloc((size_t)size, (size_t)alignment); - } - FORCE_INLINE static void Free(void* ptr) - { - _aligned_free(ptr); - } + static void Prefetch(void const* ptr); + static void* Allocate(uint64 size, uint64 alignment); + static void Free(void* ptr); static bool Is64BitPlatform(); static BatteryInfo GetBatteryInfo(); static CPUInfo GetCPUInfo();