summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsys.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2011-07-12 20:14:39 -0400
committerNat Goodspeed <nat@lindenlab.com>2011-07-12 20:14:39 -0400
commited648b1f08a191250c5c37f831280c31950b502a (patch)
tree5b2164e342ae91dd6d6d53b755e5959058980a0e /indra/llcommon/llsys.h
parente58a0e9b26dc374155b90a8f42c3a5b09e8ed1f7 (diff)
CHOP-753: Eliminate redundant array-of-pair-arrays in LLMemoryInfo.
(per Monty code review) The notion of storing LLMemoryInfo data both as an LLSD::Map and an LLSD::Array of pair arrays arose from a (possibly misguided) desire to continue producing stats output into the viewer log in the same order it always used to be produced. There is no evidence that anyone cares about the order of those stats in the log; there is no other use case for preserving order. At Monty's recommendation, eliminate generating and storing the array-of-pair-arrays form: directly store LLSD::Map.
Diffstat (limited to 'indra/llcommon/llsys.h')
-rw-r--r--indra/llcommon/llsys.h24
1 files changed, 6 insertions, 18 deletions
diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h
index 7fcb050ed0..739e795d3a 100644
--- a/indra/llcommon/llsys.h
+++ b/indra/llcommon/llsys.h
@@ -120,35 +120,23 @@ public:
static void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb);
// Retrieve a map of memory statistics. The keys of the map are platform-
- // dependent. The values are in kilobytes.
+ // dependent. The values are in kilobytes to try to avoid integer overflow.
LLSD getStatsMap() const;
- // Retrieve memory statistics: an array of pair arrays [name, value]. This
- // is the same data as presented in getStatsMap(), but it preserves the
- // order in which we retrieved it from the OS in case that's useful. The
- // set of statistics names is platform-dependent. The values are in
- // kilobytes to try to avoid integer overflow.
- LLSD getStatsArray() const;
-
- // Re-fetch memory data (as reported by stream() and getStats*()) from the
+ // Re-fetch memory data (as reported by stream() and getStatsMap()) from the
// system. Normally this is fetched at construction time. Return (*this)
// to permit usage of the form:
// @code
// LLMemoryInfo info;
// ...
- // info.refresh().getStatsArray();
+ // info.refresh().getStatsMap();
// @endcode
LLMemoryInfo& refresh();
private:
- // These methods are used to set mStatsArray and mStatsMap.
- static LLSD loadStatsArray();
- static LLSD loadStatsMap(const LLSD&);
-
- // Memory stats for getStatsArray(). It's straightforward to convert that
- // to getStatsMap() form, less so to reconstruct the original order when
- // converting the other way.
- LLSD mStatsArray;
+ // set mStatsMap
+ static LLSD loadStatsMap();
+
// Memory stats for getStatsMap().
LLSD mStatsMap;
};