diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-11-04 14:44:00 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-11-04 14:44:00 -0400 |
commit | 889aff8d87a4dbf3ca43c43bdeed825f67fd5e60 (patch) | |
tree | 0132d441993d7b26fb67e061f0c2ad50033fde8b /indra/llcommon | |
parent | e2714252f34b02ee628fb1665dfa90b932fab2f7 (diff) | |
parent | 3bbaac0b9d246939a2255ca8b06abf9568694370 (diff) |
automated merge from http://hg.secondlife.com/viewer-beta
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/lldictionary.h | 4 | ||||
-rw-r--r-- | indra/llcommon/llsys.cpp | 20 | ||||
-rw-r--r-- | indra/llcommon/llsys.h | 3 |
3 files changed, 26 insertions, 1 deletions
diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 552a805b70..bc3bc3e74a 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -78,7 +78,9 @@ protected: virtual Index notFound() const { // default is to assert - llassert(false); + // don't assert -- makes it impossible to work on mesh-development and viewer-development simultaneously + // -- davep 2010.10.29 + //llassert(false); return Index(-1); } void addEntry(Index index, Entry *entry) 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 diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 39af74e5c8..41a4f25000 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -114,6 +114,9 @@ public: ** be returned. */ U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes + + //get the available memory infomation in KiloBytes. + static void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb); }; |