summaryrefslogtreecommitdiff
path: root/indra/llcommon/llmemory.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-07-15 12:14:34 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-07-15 12:14:34 -0600
commitd9512674678bbb80b8d0d9c5105f56dbd1b2252b (patch)
treec3c8d64c683cd46d9d1e5d953dc6caca22213db4 /indra/llcommon/llmemory.cpp
parentd31e6735370711088f01cff448aa22f71c4c10c4 (diff)
parent44c7c6feaa824f4049d326965cb066e76ebefee3 (diff)
Merge from viewer-development
Diffstat (limited to 'indra/llcommon/llmemory.cpp')
-rw-r--r--indra/llcommon/llmemory.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 629e76f341..ed28974163 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -61,6 +61,10 @@ BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE;
LLPrivateMemoryPoolManager::mem_allocation_info_t LLPrivateMemoryPoolManager::sMemAllocationTracker;
#endif
+#ifndef _USE_PRIVATE_MEM_POOL_
+#define _USE_PRIVATE_MEM_POOL_ 0
+#endif
+
//static
void LLMemory::initClass()
{
@@ -224,11 +228,6 @@ void* ll_allocate (size_t size)
return p;
}
-void ll_release (void *p)
-{
- free(p);
-}
-
//----------------------------------------------------------------------------
#if defined(LL_WINDOWS)
@@ -415,7 +414,7 @@ LLMemTracker::LLMemTracker()
mDrawnIndex = 0 ;
mPaused = FALSE ;
- mMutexp = new LLMutex(NULL) ;
+ mMutexp = new LLMutex() ;
mStringBuffer = new char*[128] ;
mStringBuffer[0] = new char[mCapacity * 128] ;
for(S32 i = 1 ; i < mCapacity ; i++)
@@ -1899,6 +1898,7 @@ char* LLPrivateMemoryPoolManager::allocate(LLPrivateMemoryPool* poolp, U32 size,
//static
char* LLPrivateMemoryPoolManager::allocate(LLPrivateMemoryPool* poolp, U32 size)
{
+#if _USE_PRIVATE_MEM_POOL_
if(!poolp)
{
return new char[size] ;
@@ -1907,6 +1907,9 @@ char* LLPrivateMemoryPoolManager::allocate(LLPrivateMemoryPool* poolp, U32 size)
{
return poolp->allocate(size) ;
}
+#else
+ return (char*)malloc(size) ;
+#endif
}
#endif
@@ -1922,6 +1925,7 @@ void LLPrivateMemoryPoolManager::freeMem(LLPrivateMemoryPool* poolp, void* addr
sMemAllocationTracker.erase((char*)addr) ;
#endif
+#if _USE_PRIVATE_MEM_POOL_
if(poolp)
{
poolp->freeMem(addr) ;
@@ -1930,6 +1934,9 @@ void LLPrivateMemoryPoolManager::freeMem(LLPrivateMemoryPool* poolp, void* addr
{
delete[] (char*)addr ;
}
+#else
+ free(addr) ;
+#endif
}
//--------------------------------------------------------------------