diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-09-12 06:27:13 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-09-12 06:27:13 +0000 |
commit | da94c0eaa2ce2711f0ae26968e87ef3e409126a9 (patch) | |
tree | e0b23896f17e0a0ea60160b2c7e39331f3cb9668 /indra/llcommon | |
parent | 642cdd95726755b7c24c7f2b25e2fea8e49b5b9b (diff) |
QAR-855 Viewer 1.21 RC 2
merge viewer_1-21 94770-96059 -> release
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/linden_common.h | 6 | ||||
-rw-r--r-- | indra/llcommon/llapr.cpp | 22 | ||||
-rw-r--r-- | indra/llcommon/llapr.h | 14 | ||||
-rw-r--r-- | indra/llcommon/lldqueueptr.h | 8 | ||||
-rw-r--r-- | indra/llcommon/llthread.cpp | 12 | ||||
-rw-r--r-- | indra/llcommon/llversionviewer.h | 2 |
6 files changed, 53 insertions, 11 deletions
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 <stdlib.h> +# include <crtdbg.h> +#endif + #include "llpreprocessor.h" #include <cstring> 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 @@ -73,6 +73,28 @@ void ll_cleanup_apr() } // +//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 // LLScopedLock::LLScopedLock(apr_thread_mutex_t* mutex) : mMutex(mutex) 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 <class Type> inline LLDynamicQueuePtr<Type>::LLDynamicQueuePtr(const S32 size) { init(); - realloc(size); + reallocate(size); } template <class Type> @@ -134,7 +134,7 @@ inline void LLDynamicQueuePtr<Type>::init() } template <class Type> -inline void LLDynamicQueuePtr<Type>::realloc(U32 newsize) +inline void LLDynamicQueuePtr<Type>::reallocate(U32 newsize) { if (newsize) { @@ -308,7 +308,7 @@ inline S32 LLDynamicQueuePtr<Type>::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"; |