diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llsd.cpp | 14 | ||||
-rw-r--r-- | indra/llcommon/llsd.h | 30 |
2 files changed, 25 insertions, 19 deletions
diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 1bd5d06d29..08cb7bd2a8 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -91,7 +91,7 @@ protected: bool shared() const { return (mUseCount > 1) && (mUseCount != STATIC_USAGE_COUNT); } U32 mUseCount; - + public: static void reset(Impl*& var, Impl* impl); ///< safely set var to refer to the new impl (possibly shared) @@ -901,11 +901,6 @@ LLSD& LLSD::operator[](Integer i) const LLSD& LLSD::operator[](Integer i) const { return safe(impl).ref(i); } -#ifdef LLSD_DEBUG_INFO -U32 LLSD::allocationCount() { return Impl::sAllocationCount; } -U32 LLSD::outstandingCount() { return Impl::sOutstandingCount; } -#endif - static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat) { // sStorage is used to hold the string representation of the llsd last @@ -954,6 +949,13 @@ LLSD::array_iterator LLSD::endArray() { return makeArray(impl).endArray(); } LLSD::array_const_iterator LLSD::beginArray() const{ return safe(impl).beginArray(); } LLSD::array_const_iterator LLSD::endArray() const { return safe(impl).endArray(); } +namespace llsd +{ + +U32 allocationCount() { return LLSD::Impl::sAllocationCount; } +U32 outstandingCount() { return LLSD::Impl::sOutstandingCount; } + +} // namespace llsd // Diagnostic dump of contents in an LLSD object #ifdef LLSD_DEBUG_INFO diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h index 3519b134c2..ae083dd629 100644 --- a/indra/llcommon/llsd.h +++ b/indra/llcommon/llsd.h @@ -389,19 +389,6 @@ private: Impl* impl; friend class LLSD::Impl; //@} - - /** @name Unit Testing Interface */ - //@{ -public: -#ifdef LLSD_DEBUG_INFO - /// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED - /// ENVIRONMENT. - /// - /// These counts track LLSD::Impl (hidden) objects. - static U32 allocationCount(); ///< how many Impls have been made - static U32 outstandingCount(); ///< how many Impls are still alive -#endif - //@} private: /** @name Debugging Interface */ @@ -475,6 +462,23 @@ struct llsd_select_string : public std::unary_function<LLSD, LLSD::String> LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLSD& llsd); +namespace llsd +{ + +/** @name Unit Testing Interface */ +//@{ +#ifdef LLSD_DEBUG_INFO + /// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED + /// ENVIRONMENT. + /// + /// These counts track LLSD::Impl (hidden) objects. + LL_COMMON_API U32 allocationCount(); ///< how many Impls have been made + LL_COMMON_API U32 outstandingCount(); ///< how many Impls are still alive +#endif +//@} + +} // namespace llsd + /** QUESTIONS & TO DOS - Would Binary be more convenient as unsigned char* buffer semantics? - Should Binary be convertible to/from String, and if so how? |