Optimize compilation time for Win32 platforms

This commit is contained in:
Wojtek Figat
2021-02-20 19:45:58 +01:00
parent 115d6e46a8
commit 05d5fd4fec
2 changed files with 22 additions and 17 deletions

View File

@@ -11,12 +11,12 @@
#include "Engine/Core/Math/Math.h"
#include "IncludeWindowsHeaders.h"
#include "Engine/Core/Collections/HashFunctions.h"
#include <Psapi.h>
#include <WinSock2.h>
#include <IPHlpApi.h>
#include <oleauto.h>
#include <WinBase.h>
#include <xmmintrin.h>
#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