diff options
| author | Merov Linden <merov@lindenlab.com> | 2010-11-04 18:10:29 -0700 |
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2010-11-04 18:10:29 -0700 |
| commit | 4bbe823302427a705ea541d968f6058571a13c2f (patch) | |
| tree | d932a7a3483b674a7600b0e4bff3d0bda3344b35 /indra/llcommon/llsys.cpp | |
| parent | ba3307b8d0f2ceb40454174a6593f3f98ce98b65 (diff) | |
| parent | f7af29ab40c2405504969a453eba3919be1af5c5 (diff) | |
merge with STORM-105
Diffstat (limited to 'indra/llcommon/llsys.cpp')
| -rw-r--r-- | indra/llcommon/llsys.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 00c94404d4..10cdc7087b 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -635,6 +635,26 @@ U32 LLMemoryInfo::getPhysicalMemoryClamped() const } } +//static +void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) +{ +#if LL_WINDOWS + MEMORYSTATUSEX state; + state.dwLength = sizeof(state); + GlobalMemoryStatusEx(&state); + + avail_physical_mem_kb = (U32)(state.ullAvailPhys/1024) ; + avail_virtual_mem_kb = (U32)(state.ullAvailVirtual/1024) ; + +#else + //do not know how to collect available memory info for other systems. + //leave it blank here for now. + + avail_physical_mem_kb = -1 ; + avail_virtual_mem_kb = -1 ; +#endif +} + void LLMemoryInfo::stream(std::ostream& s) const { #if LL_WINDOWS |
