Skip to content

Commit

Permalink
xrCore: add platform name to log output
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Nov 6, 2018
1 parent 84a0180 commit b4add92
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/xrCore/xrMemory.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "stdafx.h"

#include "SDL.h"

#if defined(WINDOWS)
#include <Psapi.h>
#elif defined(LINUX)
Expand Down Expand Up @@ -48,8 +50,8 @@ XRCORE_API void vminfo(size_t* _free, size_t* reserved, size_t* committed)
memory_info.BaseAddress = (char*)memory_info.BaseAddress + memory_info.RegionSize;
}
#elif defined(LINUX)
struct sysinfo si;
sysinfo(&si);
struct sysinfo si;
sysinfo(&si);
*_free = si.freeram * si.mem_unit;
*reserved = si.bufferram * si.mem_unit;
*committed = (si.totalram - si.freeram + si.totalswap - si.freeswap) * si.mem_unit;
Expand All @@ -60,7 +62,7 @@ XRCORE_API void log_vminfo()
{
size_t w_free, w_reserved, w_committed;
vminfo(&w_free, &w_reserved, &w_committed);
Msg("* [win32]: free[%d K], reserved[%d K], committed[%d K]", w_free / 1024, w_reserved / 1024, w_committed / 1024);
Msg("* [ %s ]: free[%d K], reserved[%d K], committed[%d K]", SDL_GetPlatform(), w_free / 1024, w_reserved / 1024, w_committed / 1024);
}

size_t xrMemory::mem_usage()
Expand Down

0 comments on commit b4add92

Please sign in to comment.