Fix Platform::GetCacheLineSize to be deprecated in favor of CPUInfo

This commit is contained in:
Wojtek Figat
2025-03-04 22:57:58 +01:00
parent 668511a727
commit 06665734e7
10 changed files with 7 additions and 25 deletions

View File

@@ -709,11 +709,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

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

View File

@@ -357,9 +357,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 CacheLineSize field from CPUInfo.") static int32 GetCacheLineSize();
/// <summary>
/// Gets the current memory stats.

View File

@@ -1766,11 +1766,6 @@ CPUInfo LinuxPlatform::GetCPUInfo()
return UnixCpu;
}
int32 LinuxPlatform::GetCacheLineSize()
{
return UnixCpu.CacheLineSize;
}
MemoryStats LinuxPlatform::GetMemoryStats()
{
// Get memory usage

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

@@ -304,11 +304,6 @@ CPUInfo Win32Platform::GetCPUInfo()
return CpuInfo;
}
int32 Win32Platform::GetCacheLineSize()
{
return CpuInfo.CacheLineSize;
}
MemoryStats Win32Platform::GetMemoryStats()
{
// Get memory stats

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();