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__
|
#if defined __APPLE__
|
||||||
# include "TargetConditionals.h"
|
# include "TargetConditionals.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if defined __linux__
|
||||||
|
# include <sys/sysinfo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
@ -284,6 +287,10 @@ static const char* GetHostInfo()
|
|||||||
statex.dwLength = sizeof( statex );
|
statex.dwLength = sizeof( statex );
|
||||||
GlobalMemoryStatusEx( &statex );
|
GlobalMemoryStatusEx( &statex );
|
||||||
ptr += sprintf( ptr, "RAM: %i MB\n", statex.ullTotalPhys / 1024 / 1024 );
|
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
|
#else
|
||||||
ptr += sprintf( ptr, "RAM: unknown\n" );
|
ptr += sprintf( ptr, "RAM: unknown\n" );
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user