Fix Platform::GetCacheLineSize to be deprecated in favor of existing CPUInfo.CacheLineSize`

This commit is contained in:
Wojtek Figat
2025-03-06 09:08:00 +01:00
parent 772f7f7fd2
commit cc7d88d4a9
10 changed files with 7 additions and 25 deletions

View File

@@ -710,11 +710,6 @@ CPUInfo AndroidPlatform::GetCPUInfo()
return AndroidCpu;
}
int32 AndroidPlatform::GetCacheLineSize()
{
return AndroidCpu.CacheLineSize;
}
MemoryStats AndroidPlatform::GetMemoryStats()
{
const uint64 pageSize = getpagesize();

View File

@@ -81,7 +81,6 @@ public:
}
static bool Is64BitPlatform();
static CPUInfo GetCPUInfo();
static int32 GetCacheLineSize();
static MemoryStats GetMemoryStats();
static ProcessMemoryStats GetProcessMemoryStats();
static uint64 GetCurrentThreadID()

View File

@@ -134,11 +134,6 @@ CPUInfo ApplePlatform::GetCPUInfo()
return Cpu;
}
int32 ApplePlatform::GetCacheLineSize()
{
return Cpu.CacheLineSize;
}
MemoryStats ApplePlatform::GetMemoryStats()
{
MemoryStats result;

View File

@@ -67,7 +67,6 @@ public:
}
static bool Is64BitPlatform();
static CPUInfo GetCPUInfo();
static int32 GetCacheLineSize();
static MemoryStats GetMemoryStats();
static ProcessMemoryStats GetProcessMemoryStats();
static uint64 GetCurrentThreadID();

View File

@@ -270,6 +270,11 @@ bool PlatformBase::Is64BitApp()
#endif
}
int32 PlatformBase::GetCacheLineSize()
{
return Platform::GetCPUInfo().CacheLineSize;
}
void PlatformBase::Fatal(const StringView& msg, void* context, FatalErrorType error)
{
// Check if is already during fatal state

View File

@@ -380,9 +380,10 @@ public:
/// <summary>
/// Gets the CPU cache line size.
/// [Deprecated in v1.10]
/// </summary>
/// <returns>The cache line size.</returns>
API_PROPERTY() static int32 GetCacheLineSize() = delete;
API_PROPERTY() DEPRECATED("Use CPUInfo.CacheLineSize instead") static int32 GetCacheLineSize();
/// <summary>
/// Gets the current memory stats.

View File

@@ -1767,11 +1767,6 @@ CPUInfo LinuxPlatform::GetCPUInfo()
return UnixCpu;
}
int32 LinuxPlatform::GetCacheLineSize()
{
return UnixCpu.CacheLineSize;
}
MemoryStats LinuxPlatform::GetMemoryStats()
{
const uint64 pageSize = getpagesize();

View File

@@ -95,7 +95,6 @@ public:
}
static bool Is64BitPlatform();
static CPUInfo GetCPUInfo();
static int32 GetCacheLineSize();
static MemoryStats GetMemoryStats();
static ProcessMemoryStats GetProcessMemoryStats();
static uint64 GetCurrentThreadID()

View File

@@ -310,11 +310,6 @@ CPUInfo Win32Platform::GetCPUInfo()
return CpuInfo;
}
int32 Win32Platform::GetCacheLineSize()
{
return CpuInfo.CacheLineSize;
}
MemoryStats Win32Platform::GetMemoryStats()
{
MEMORYSTATUSEX statex;

View File

@@ -90,7 +90,6 @@ public:
static void FreePages(void* ptr);
static bool Is64BitPlatform();
static CPUInfo GetCPUInfo();
static int32 GetCacheLineSize();
static MemoryStats GetMemoryStats();
static ProcessMemoryStats GetProcessMemoryStats();
static uint64 GetCurrentProcessId();