From da94c0eaa2ce2711f0ae26968e87ef3e409126a9 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Fri, 12 Sep 2008 06:27:13 +0000 Subject: QAR-855 Viewer 1.21 RC 2 merge viewer_1-21 94770-96059 -> release --- indra/llcommon/linden_common.h | 6 ++++++ indra/llcommon/llapr.cpp | 22 ++++++++++++++++++++++ indra/llcommon/llapr.h | 14 ++++++++++++++ indra/llcommon/lldqueueptr.h | 8 ++++---- indra/llcommon/llthread.cpp | 12 ++++++------ indra/llcommon/llversionviewer.h | 2 +- 6 files changed, 53 insertions(+), 11 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h index 60ea21d642..1581522a2e 100644 --- a/indra/llcommon/linden_common.h +++ b/indra/llcommon/linden_common.h @@ -32,6 +32,12 @@ #ifndef LL_LINDEN_COMMON_H #define LL_LINDEN_COMMON_H +#if defined(LL_WINDOWS) && defined(_DEBUG) +# define _CRTDBG_MAP_ALLOC +# include +# include +#endif + #include "llpreprocessor.h" #include diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index e83473216a..697f380f98 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -72,6 +72,28 @@ void ll_cleanup_apr() apr_terminate(); } +// +//LLAPRPool +// +LLAPRPool::LLAPRPool(apr_pool_t *parent, apr_size_t size) +{ + mStatus = apr_pool_create(&mPool, parent); + + if(size > 0) //size is the number of blocks (which is usually 4K), NOT bytes. + { + apr_allocator_t *allocator = apr_pool_allocator_get(mPool); + if (allocator) + { + apr_allocator_max_free_set(allocator, size) ; + } + } +} + +LLAPRPool::~LLAPRPool() +{ + apr_pool_destroy(mPool) ; +} + // // LLScopedLock // diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 403d504932..7d6dd4590f 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -60,6 +60,20 @@ void ll_init_apr(); */ void ll_cleanup_apr(); +class LLAPRPool +{ +public: + LLAPRPool(apr_pool_t *parent = NULL, apr_size_t size = 0) ; + ~LLAPRPool() ; + + apr_pool_t* getAPRPool() {return mPool ; } + apr_status_t getStatus() {return mStatus ; } + +private: + apr_pool_t* mPool ; + apr_status_t mStatus ; +} ; + /** * @class LLScopedLock * @brief Small class to help lock and unlock mutexes. diff --git a/indra/llcommon/lldqueueptr.h b/indra/llcommon/lldqueueptr.h index 06eee34cbc..0999e6754a 100644 --- a/indra/llcommon/lldqueueptr.h +++ b/indra/llcommon/lldqueueptr.h @@ -47,7 +47,7 @@ public: void init(); void destroy(); void reset(); - void realloc(U32 newsize); + void reallocate(U32 newsize); // ACCESSORS const Type& get(const S32 index) const; // no bounds checking @@ -115,7 +115,7 @@ template inline LLDynamicQueuePtr::LLDynamicQueuePtr(const S32 size) { init(); - realloc(size); + reallocate(size); } template @@ -134,7 +134,7 @@ inline void LLDynamicQueuePtr::init() } template -inline void LLDynamicQueuePtr::realloc(U32 newsize) +inline void LLDynamicQueuePtr::reallocate(U32 newsize) { if (newsize) { @@ -308,7 +308,7 @@ inline S32 LLDynamicQueuePtr::push(const Type &obj) { if (mMaxObj - count() <= 1) { - realloc(mMaxObj * 2); + reallocate(mMaxObj * 2); } mMemory[mLastObj++] = obj; diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index cc58552099..81cae60f3b 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -266,12 +266,12 @@ void LLThread::wakeLocked() LLMutex::LLMutex(apr_pool_t *poolp) : mAPRMutexp(NULL) { - if (poolp) - { - mIsLocalPool = FALSE; - mAPRPoolp = poolp; - } - else + //if (poolp) + //{ + // mIsLocalPool = FALSE; + // mAPRPoolp = poolp; + //} + //else { mIsLocalPool = TRUE; apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 0555b9ea3c..ce8d1e5759 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -34,7 +34,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 21; -const S32 LL_VERSION_PATCH = 0; +const S32 LL_VERSION_PATCH = 2; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Release"; -- cgit v1.2.3