summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsys.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2010-12-09 11:07:50 -0500
committerMonty Brandenberg <monty@lindenlab.com>2010-12-09 11:07:50 -0500
commitb9cf73c29b4b87a391c78415e4c09c31b4ac045c (patch)
treed843f4e78bc6874001cb81fc993cc59d0a179a83 /indra/llcommon/llsys.cpp
parenta59c43f1adff35107e59fdfc3016d4329324bbaf (diff)
parentd9b4570883652d647c05083c18fac1a088efd6e2 (diff)
merge from http://hg.secondlife.com/viewer-development
Diffstat (limited to 'indra/llcommon/llsys.cpp')
-rw-r--r--indra/llcommon/llsys.cpp20
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