Core/HardwareInfo: Added GetTotalMemory
Former-commit-id: 71289723115161dd253ccb65c1c91af65344c678
This commit is contained in:
@@ -24,6 +24,14 @@ unsigned int NzHardwareInfoImpl::GetProcessorCount()
|
||||
return sysconf(_SC_NPROCESSORS_CONF);
|
||||
}
|
||||
|
||||
nzUInt64 NzHardwareInfoImpl::GetTotalMemory()
|
||||
{
|
||||
nzUInt64 pages = sysconf(_SC_PHYS_PAGES);
|
||||
nzUInt64 page_size = sysconf(_SC_PAGE_SIZE);
|
||||
|
||||
return pages * page_size;
|
||||
}
|
||||
|
||||
bool NzHardwareInfoImpl::IsCpuidSupported()
|
||||
{
|
||||
#ifdef NAZARA_PLATFORM_x64
|
||||
|
||||
@@ -15,6 +15,7 @@ class NzHardwareInfoImpl
|
||||
public:
|
||||
static void Cpuid(nzUInt32 functionId, nzUInt32 subFunctionId, nzUInt32 registers[4]);
|
||||
static unsigned int GetProcessorCount();
|
||||
static nzUInt64 GetTotalMemory();
|
||||
static bool IsCpuidSupported();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user