mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
System RAM discovery on Linux.
This commit is contained in:
parent
790a3ae26f
commit
e9170c862e
@ -55,6 +55,9 @@ extern "C" typedef LONG (WINAPI *t_RtlGetVersion)( PRTL_OSVERSIONINFOW );
|
||||
#if defined __APPLE__
|
||||
# include "TargetConditionals.h"
|
||||
#endif
|
||||
#if defined __linux__
|
||||
# include <sys/sysinfo.h>
|
||||
#endif
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
@ -284,6 +287,10 @@ static const char* GetHostInfo()
|
||||
statex.dwLength = sizeof( statex );
|
||||
GlobalMemoryStatusEx( &statex );
|
||||
ptr += sprintf( ptr, "RAM: %i MB\n", statex.ullTotalPhys / 1024 / 1024 );
|
||||
#elif defined __linux__
|
||||
struct sysinfo sysInfo;
|
||||
sysinfo( &sysInfo );
|
||||
ptr += sprintf( ptr, "RAM: %i MB\n", sysInfo.totalram / 1024 / 1024 );
|
||||
#else
|
||||
ptr += sprintf( ptr, "RAM: unknown\n" );
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user