Stinson Linden avatar Stinson Linden committed a4ae332 Merge

Comments (0)

Files changed (127)

 4e9eec6a347f89b2b3f295beb72f1cf7837dff66 2.6.0-start
 9283d6d1d7eb71dfe4c330e7c9144857e7356bde 2.6.0-beta1
 9283d6d1d7eb71dfe4c330e7c9144857e7356bde DRTVWR-40_2.6.0-beta1
+461c8c65b5c799ddfe365422f9be9c0095d91e7d 2.6.0-beta1-tip
 9e4641f4a7870c0f565a25a2971368d5a29516a1 2.6.0-beta2
 9e4641f4a7870c0f565a25a2971368d5a29516a1 DRTVWR-41_2.6.0-beta2
 42f32494bac475d0737799346f6831558ae8bf5d 2.6.0-release
 eb539c65e6ee26eea2bf373af2d0f4b52dc91289 DRTVWR-177
 a8057e1b9a1246b434a27405be35e030f7d28b0c 3.3.4-beta3
 888768f162d2c0a8de1dcc5fb9a08bd8bd120a6b DRTVWR-175
-4ad8a3afe40e0200309e3ada68932c4295ac2795 DRTVWR-179
 4281aa899fb2cedb7a9ca7ce91c5c29d4aa69594 DRTVWR-180
 5c08e1d8edd871807153603b690e3ee9dbb548aa DRTVWR-183
 6c75f220b103db1420919c8b635fe53e2177f318 3.3.4-beta4
 7b22c612fc756e0ea63b10b163e81d107f85dbf8 DRTVWR-206
 8c9085066c78ed5f6c9379dc054c82a6fcdb1851 DRTVWR-207
 351eea5f9dc192fc5ddea3b02958de97677a0a12 3.3.4-release3
+af7b28e75bd5a629cd9e0dc46fb3f1757626f493 DRTVWR-212
+015012c2b740ccdec8a8c3d6e5f898449ecfe0b8 DRTVWR-213
+62b07aa81b1957897c3846292bb9412977b0af6c 3.3.4-beta6
+ceed0b65a69f1eac20d523e0203320a32f9a3f3c DRTVWR-215
+733ceac77583874f3626ef7a15c105b83ef0f5bb 3.4.0-beta7
+97977c67245f52db20eb15f1918cc0f24778cabc 3.4.0-release
+5adb2b8f96c3cac88ad7c7d996d707f1b29df336 3.4.1-beta1
+b3f74858a1c8720c82d0978f3877a3fc8ba459ec 3.4.1-beta1a
+b61afe175b829c149d369524a4e974dfda99facf DRTVWR-219
+2b779f233ee6f38c89cb921650c773a96e63da92 DRTVWR-220
+0b9d95f4bfb6867cbf56eaec51633b0da2f1262d DRTVWR-221
+e6e553761829dc0270eaaa712b7cb0622535b076 3.4.1-beta3
+f00068a66a2e2f72acbe3f690b98b323e740b289 DRTVWR-222
+305950187c628a5d6743ee9ea711cc5b9177a18e 3.4.1-beta4
+dd23d4da3bcb2ffda58569e759feb7c119982973 DRTVWR-224
+0bd3744ff060452aa13ff4992eafb381df7b1012 3.4.1-beta5
+29075f8c1abed53dcf195a59f61744e27a91108f DRTVWR-226
+fba99f381b8d4ad1b7b42fa4993b29998d95be18 DRTVWR-179
+49ed253c80bed7410e238eeab35a9f14cb034364 3.4.1-beta6
+468ca3268229011a59df99229b24315844b33d34 DRTVWR-227
+524da902713e8b60322640b9825101add4a7c497 3.4.1-beta7
+173c2809f9873499c4b9d6bc044ec941c954d3fb DRTVWR-228
+1dc94555582f52718834081e7659e973ae4521f7 3.4.1-beta8
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>dde928cb24d22a267004a8c17669ba65</string>
+              <string>8aedfdcf670348c18a9991ae1b384a61</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/226426/arch/Linux/installer/google_perftools-1.7-linux-20110412.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>8308f7bd68bb7083655753b7abe7225f</string>
+              <string>f62841804acb91e1309603a84f3f0ce8</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/226287/arch/CYGWIN/installer/google_perftools-1.7-windows-20110411.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
 
     check_for "After 'autobuild configure'" ${build_dir}/packages/dictionaries
 
-  end_section "Pre$variant"
+ end_section "Pre$variant"
 }
 
 package_llphysicsextensions_tpv()
Add a comment to this file

indra/cmake/00-Common.cmake

File contents unchanged.

Add a comment to this file

indra/cmake/Copy3rdPartyLibs.cmake

File contents unchanged.

indra/cmake/GooglePerfTools.cmake

 
 # If you want to enable or disable TCMALLOC in viewer builds, this is the place.
 # set ON or OFF as desired.
-set (USE_TCMALLOC ON)
+set (USE_TCMALLOC OFF)
 
 if (STANDALONE)
   include(FindGooglePerfTools)
Add a comment to this file

indra/cmake/LLAddBuildTest.cmake

File contents unchanged.

Add a comment to this file

indra/llaudio/llaudiodecodemgr.cpp

File contents unchanged.

Add a comment to this file

indra/llcharacter/llcharacter.cpp

File contents unchanged.

Add a comment to this file

indra/llcharacter/lleditingmotion.cpp

File contents unchanged.

Add a comment to this file

indra/llcharacter/llkeyframewalkmotion.cpp

File contents unchanged.

Add a comment to this file

indra/llcharacter/llmotioncontroller.cpp

File contents unchanged.

Add a comment to this file

indra/llcommon/llallocator.cpp

File contents unchanged.

indra/llcommon/llapp.cpp

 	// occasionally checks to see if the app is in an error state, and sees if it needs to be run.
 
 #if LL_WINDOWS
+#if LL_SEND_CRASH_REPORTS
 	// This sets a callback to handle w32 signals to the console window.
 	// The viewer shouldn't be affected, sicne its a windowed app.
 	SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ConsoleCtrlHandler, TRUE);
 		mExceptionHandler = new google_breakpad::ExceptionHandler(
 			L"C:\\Temp\\", 0, windows_post_minidump_callback, 0, google_breakpad::ExceptionHandler::HANDLER_ALL);
 	}
-
+#endif
 #else
 	//
 	// Start up signal handling.

indra/llcommon/llmemory.cpp

 	return sAllocatedMemInKB ;
 }
 
-void* ll_allocate (size_t size)
-{
-	if (size == 0)
-	{
-		llwarns << "Null allocation" << llendl;
-	}
-	void *p = malloc(size);
-	if (p == NULL)
-	{
-		LLMemory::freeReserve();
-		llerrs << "Out of memory Error" << llendl;
-	}
-	return p;
-}
-
 //----------------------------------------------------------------------------
 
 #if defined(LL_WINDOWS)
 	//if the asked size larger than MAX_BLOCK_SIZE, fetch from heap directly, the pool does not manage it
 	if(size >= CHUNK_SIZE)
 	{
-		return (char*)malloc(size) ;
+		return (char*)ll_aligned_malloc_16(size) ;
 	}
 
 	char* p = NULL ;
 			to_log = false ;
 		}
 
-		return (char*)malloc(size) ;
+		return (char*)ll_aligned_malloc_16(size) ;
 	}
 
 	return p ;
 	
 	if(!chunk)
 	{
-		free(addr) ; //release from heap
+		ll_aligned_free_16(addr) ; //release from heap
 	}
 	else
 	{
 
 	mReservedPoolSize += preferred_size + overhead ;
 
-	char* buffer = (char*)malloc(preferred_size + overhead) ;
+	char* buffer = (char*)ll_aligned_malloc_16(preferred_size + overhead) ;
 	if(!buffer)
 	{
 		return NULL ;
 	mReservedPoolSize -= chunk->getBufferSize() ;
 	
 	//release memory
-	free(chunk->getBuffer()) ;
+	ll_aligned_free_16(chunk->getBuffer()) ;
 }
 
 U16 LLPrivateMemoryPool::findHashKey(const char* addr)
 
 	if(!poolp)
 	{
-		p = (char*)malloc(size) ;
+		p = (char*)ll_aligned_malloc_16(size) ;
 	}
 	else
 	{
 	}
 	else
 	{
-		return (char*)malloc(size) ;
+		return (char*)ll_aligned_malloc_16(size) ;
 	}
 }
 #endif
 	{
 		if(!sPrivatePoolEnabled)
 		{
-			free(addr) ; //private pool is disabled.
+			ll_aligned_free_16(addr) ; //private pool is disabled.
 		}
 		else if(!sInstance) //the private memory manager is destroyed, try the dangling list
 		{

indra/llcommon/llmemory.h

 #define LLMEMORY_H
 
 #include "llmemtype.h"
+
+#if LL_WINDOWS && LL_DEBUG
+#define LL_CHECK_MEMORY llassert(_CrtCheckMemory());
+#else
+#define LL_CHECK_MEMORY
+#endif
+
 inline void* ll_aligned_malloc( size_t size, int align )
 {
 	void* mem = malloc( size + (align - 1) + sizeof(void*) );
 #endif
 }
 
-inline void* ll_aligned_realloc_16(void* ptr, size_t size) // returned hunk MUST be freed with ll_aligned_free_16().
-{
-#if defined(LL_WINDOWS)
-	return _aligned_realloc(ptr, size, 16);
-#elif defined(LL_DARWIN)
-	return realloc(ptr,size); // default osx malloc is 16 byte aligned.
-#else
-	return realloc(ptr,size); // FIXME not guaranteed to be aligned.
-#endif
-}
-
 inline void ll_aligned_free_16(void *p)
 {
 #if defined(LL_WINDOWS)
 	free(p); // posix_memalign() is compatible with heap deallocator
 #endif
 }
+
+inline void* ll_aligned_realloc_16(void* ptr, size_t size, size_t old_size) // returned hunk MUST be freed with ll_aligned_free_16().
+{
+#if defined(LL_WINDOWS)
+	return _aligned_realloc(ptr, size, 16);
+#elif defined(LL_DARWIN)
+	return realloc(ptr,size); // default osx malloc is 16 byte aligned.
+#else
+	//FIXME: memcpy is SLOW
+	void* ret = ll_aligned_malloc_16(size);
+	if (ptr)
+	{
+		memcpy(ret, ptr, old_size);
+		ll_aligned_free_16(ptr);
+	}
+	return ret;
+#endif
+}
+
 #else // USE_TCMALLOC
 // ll_aligned_foo_16 are not needed with tcmalloc
 #define ll_aligned_malloc_16 malloc
-#define ll_aligned_realloc_16 realloc
+#define ll_aligned_realloc_16(a,b,c) realloc(a,b)
 #define ll_aligned_free_16 free
 #endif // USE_TCMALLOC
 

indra/llcommon/llqueuedthread.cpp

 		pending = getPending();
 		if(pending > 0)
 		{
-		unpause();
-	}
+			unpause();
+		}
 	}
 	else
 	{

indra/llcommon/llthread.cpp

 		apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread
 	}
 	mRunCondition = new LLCondition(mAPRPoolp);
-
+	mDataLock = new LLMutex(mAPRPoolp);
 	mLocalAPRFilePoolp = NULL ;
 }
 
 	}
 
 	delete mRunCondition;
-	mRunCondition = 0;
+	mRunCondition = NULL;
+
+	delete mDataLock;
+	mDataLock = NULL;
 	
 	if (mIsLocalPool && mAPRPoolp)
 	{
 // Stop thread execution if requested until unpaused.
 void LLThread::checkPause()
 {
-	mRunCondition->lock();
+	mDataLock->lock();
 
 	// This is in a while loop because the pthread API allows for spurious wakeups.
 	while(shouldSleep())
 	{
+		mDataLock->unlock();
 		mRunCondition->wait(); // unlocks mRunCondition
+		mDataLock->lock();
 		// mRunCondition is locked when the thread wakes up
 	}
 	
- 	mRunCondition->unlock();
+ 	mDataLock->unlock();
 }
 
 //============================================================================
 
 void LLThread::setQuitting()
 {
-	mRunCondition->lock();
+	mDataLock->lock();
 	if (mStatus == RUNNING)
 	{
 		mStatus = QUITTING;
 	}
-	mRunCondition->unlock();
+	mDataLock->unlock();
 	wake();
 }
 
 
 void LLThread::wake()
 {
-	mRunCondition->lock();
+	mDataLock->lock();
 	if(!shouldSleep())
 	{
 		mRunCondition->signal();
 	}
-	mRunCondition->unlock();
+	mDataLock->unlock();
 }
 
 void LLThread::wakeLocked()
 {
 }
 
+LLThreadSafeRefCount::LLThreadSafeRefCount(const LLThreadSafeRefCount& src)
+{
+	if (sMutex)
+	{
+		sMutex->lock();
+	}
+	mRef = 0;
+	if (sMutex)
+	{
+		sMutex->unlock();
+	}
+}
+
 LLThreadSafeRefCount::~LLThreadSafeRefCount()
 { 
 	if (mRef != 0)
 	}
 }
 
+
 //============================================================================
 
 LLResponder::~LLResponder()

indra/llcommon/llthread.h

 protected:
 	std::string			mName;
 	LLCondition*		mRunCondition;
+	LLMutex*			mDataLock;
 
 	apr_thread_t		*mAPRThreadp;
 	apr_pool_t			*mAPRPoolp;
 	inline void unlockData();
 	
 	// This is the predicate that decides whether the thread should sleep.  
-	// It should only be called with mRunCondition locked, since the virtual runCondition() function may need to access
+	// It should only be called with mDataLock locked, since the virtual runCondition() function may need to access
 	// data structures that are thread-unsafe.
 	bool shouldSleep(void) { return (mStatus == RUNNING) && (isPaused() || (!runCondition())); }
 
 	// To avoid spurious signals (and the associated context switches) when the condition may or may not have changed, you can do the following:
-	// mRunCondition->lock();
+	// mDataLock->lock();
 	// if(!shouldSleep())
 	//     mRunCondition->signal();
-	// mRunCondition->unlock();
+	// mDataLock->unlock();
 };
 
 //============================================================================
 
 void LLThread::lockData()
 {
-	mRunCondition->lock();
+	mDataLock->lock();
 }
 
 void LLThread::unlockData()
 {
-	mRunCondition->unlock();
+	mDataLock->unlock();
 }
 
 
 private:
 	static LLMutex* sMutex;
 
-private:
-	LLThreadSafeRefCount(const LLThreadSafeRefCount&); // not implemented
-	LLThreadSafeRefCount&operator=(const LLThreadSafeRefCount&); // not implemented
-
 protected:
 	virtual ~LLThreadSafeRefCount(); // use unref()
 	
 public:
 	LLThreadSafeRefCount();
+	LLThreadSafeRefCount(const LLThreadSafeRefCount&);
+	LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref) 
+	{
+		if (sMutex)
+		{
+			sMutex->lock();
+		}
+		mRef = 0;
+		if (sMutex)
+		{
+			sMutex->unlock();
+		}
+		return *this;
+	}
+
+
 	
 	void ref()
 	{

indra/llcommon/llversionviewer.h

 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 4;
-const S32 LL_VERSION_PATCH = 1;
+const S32 LL_VERSION_PATCH = 2;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";

indra/llimage/llimage.cpp

 	dst[1] = (U8)(((U32)(a[1]) + b[1] + c[1] + d[1])>>2);
 }
 
+void LLImageBase::setDataAndSize(U8 *data, S32 size)
+{ 
+	ll_assert_aligned(data, 16);
+	mData = data; mDataSize = size; 
+}	
+
 //static
 void LLImageBase::generateMip(const U8* indata, U8* mipdata, S32 width, S32 height, S32 nchannels)
 {

indra/llimage/llimage.h

 
 protected:
 	// special accessor to allow direct setting of mData and mDataSize by LLImageFormatted
-	void setDataAndSize(U8 *data, S32 size) { mData = data; mDataSize = size; }	
+	void setDataAndSize(U8 *data, S32 size);
 	
 public:
 	static void generateMip(const U8 *indata, U8* mipdata, int width, int height, S32 nchannels);
Add a comment to this file

indra/llmath/CMakeLists.txt

File contents unchanged.

Add a comment to this file

indra/llmath/llcamera.h

File contents unchanged.

Add a comment to this file

indra/llmath/llmatrix3a.h

File contents unchanged.

Add a comment to this file

indra/llmath/llmatrix4a.h

File contents unchanged.

Add a comment to this file

indra/llmath/lloctree.h

File contents unchanged.

File contents unchanged.

Add a comment to this file

indra/llmath/llsimdmath.h

File contents unchanged.

Add a comment to this file

indra/llmath/llsimdtypes.inl

File contents unchanged.

Add a comment to this file

indra/llmath/llvector4a.cpp

File contents unchanged.

Add a comment to this file

indra/llmath/llvector4a.h

File contents unchanged.

Add a comment to this file

indra/llmath/llvector4a.inl

File contents unchanged.

Add a comment to this file

indra/llmath/llvector4logical.h

File contents unchanged.

indra/llmath/llvolume.cpp

 {
 	S32 new_verts = mNumVertices+1;
 	S32 new_size = new_verts*16;
-//	S32 old_size = mNumVertices*16;
+	S32 old_size = mNumVertices*16;
 
 	//positions
-	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_size);
+	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_size, old_size);
 	ll_assert_aligned(mPositions,16);
 	
 	//normals
-	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_size);
+	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_size, old_size);
 	ll_assert_aligned(mNormals,16);
 
 	//tex coords
 	new_size = ((new_verts*8)+0xF) & ~0xF;
-	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, new_size);
+	old_size = ((mNumVertices*8)+0xF) & ~0xF;
+	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, new_size, old_size);
 	ll_assert_aligned(mTexCoords,16);
 	
 
 	S32 old_size = ((mNumIndices*2)+0xF) & ~0xF;
 	if (new_size != old_size)
 	{
-		mIndices = (U16*) ll_aligned_realloc_16(mIndices, new_size);
+		mIndices = (U16*) ll_aligned_realloc_16(mIndices, new_size, old_size);
 		ll_assert_aligned(mIndices,16);
 	}
 	
 	}
 
 	//allocate new buffer space
-	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_count*sizeof(LLVector4a));
+	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_count*sizeof(LLVector4a), mNumVertices*sizeof(LLVector4a));
 	ll_assert_aligned(mPositions, 16);
-	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_count*sizeof(LLVector4a));
+	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_count*sizeof(LLVector4a), mNumVertices*sizeof(LLVector4a));
 	ll_assert_aligned(mNormals, 16);
-	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, (new_count*sizeof(LLVector2)+0xF) & ~0xF);
+	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, (new_count*sizeof(LLVector2)+0xF) & ~0xF, (mNumVertices*sizeof(LLVector2)+0xF) & ~0xF);
 	ll_assert_aligned(mTexCoords, 16);
 	
 	mNumVertices = new_count;
 	new_count = mNumIndices + face.mNumIndices;
 
 	//allocate new index buffer
-	mIndices = (U16*) ll_aligned_realloc_16(mIndices, (new_count*sizeof(U16)+0xF) & ~0xF);
+	mIndices = (U16*) ll_aligned_realloc_16(mIndices, (new_count*sizeof(U16)+0xF) & ~0xF, (mNumIndices*sizeof(U16)+0xF) & ~0xF);
 	
 	//get destination address into new index buffer
 	U16* dst_idx = mIndices+mNumIndices;
Add a comment to this file

indra/llmath/llvolumeoctree.cpp

File contents unchanged.

Add a comment to this file

indra/llmath/llvolumeoctree.h

File contents unchanged.

indra/llmath/tests/alignment_test.cpp

 #include "../llsimdmath.h"
 #include "../llvector4a.h"
 
-void* operator new(size_t size)
-{
-	return ll_aligned_malloc_16(size);
-}
-
-void operator delete(void *p)
-{
-	ll_aligned_free_16(p);
-}
-
 namespace tut
 {
 
 LL_ALIGN_PREFIX(16)
 class MyVector4a
 {
+public:
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void *p)
+	{
+		ll_aligned_free_16(p);
+	}
+
+	void* operator new[](size_t count)
+	{	// try to allocate count bytes for an array
+		return ll_aligned_malloc_16(count);
+	}
+
+	void operator delete[](void *p)
+	{
+		ll_aligned_free_16(p);
+	}
+
 	LLQuad mQ;
 } LL_ALIGN_POSTFIX(16);
 
 		align_ptr = ll_aligned_malloc_16(sizeof(MyVector4a));
 		ensure("ll_aligned_malloc_16 failed", is_aligned(align_ptr,16));
 
-		align_ptr = ll_aligned_realloc_16(align_ptr,2*sizeof(MyVector4a));
+		align_ptr = ll_aligned_realloc_16(align_ptr,2*sizeof(MyVector4a), sizeof(MyVector4a));
 		ensure("ll_aligned_realloc_16 failed", is_aligned(align_ptr,16));
 
 		ll_aligned_free_16(align_ptr);

indra/llmessage/llcurl.cpp

 //////////////////////////////////////////////////////////////////////////////
 
 LLCurl::Responder::Responder()
-	: mReferenceCount(0)
 {
 }
 
 LLCurl::Responder::~Responder()
 {
+	LL_CHECK_MEMORY
 }
 
 // virtual
 
 }
 
-namespace boost
-{
-	void intrusive_ptr_add_ref(LLCurl::Responder* p)
-	{
-		++p->mReferenceCount;
-	}
-	
-	void intrusive_ptr_release(LLCurl::Responder* p)
-	{
-		if (p && 0 == --p->mReferenceCount)
-		{
-			delete p;
-		}
-	}
-};
-
-
 //////////////////////////////////////////////////////////////////////////////
 
 std::set<CURL*> LLCurl::Easy::sFreeHandles;
 	LLMutexLock lock(sHandleMutexp) ;
 	if (sActiveHandles.find(handle) != sActiveHandles.end())
 	{
+		LL_CHECK_MEMORY
 		sActiveHandles.erase(handle);
-
+		LL_CHECK_MEMORY
 		if(sFreeHandles.size() < MAX_NUM_FREE_HANDLES)
 		{
-		sFreeHandles.insert(handle);
-	}
-	else
-	{
+			sFreeHandles.insert(handle);
+			LL_CHECK_MEMORY
+		}
+		else
+		{
 			LLCurl::deleteEasyHandle(handle) ;
+			LL_CHECK_MEMORY
 		}
 	}
 	else
 	releaseEasyHandle(mCurlEasyHandle);
 	--gCurlEasyCount;
 	curl_slist_free_all(mHeaders);
+	LL_CHECK_MEMORY
 	for_each(mStrings.begin(), mStrings.end(), DeletePointerArray());
-
+	LL_CHECK_MEMORY
 	if (mResponder && LLCurl::sNotQuitting) //aborted
 	{	
 		std::string reason("Request timeout, aborted.") ;
 		mResponder->completedRaw(408, //HTTP_REQUEST_TIME_OUT, timeout, abort
 			reason, mChannels, mOutput);		
+		LL_CHECK_MEMORY
 	}
 	mResponder = NULL;
 }
 	llassert_always(deleted || !mValid) ;
 
 	LLMutexLock lock(mDeletionMutexp);
-	
+
+
 	// Clean up active
 	for(easy_active_list_t::iterator iter = mEasyActiveList.begin();
 		iter != mEasyActiveList.end(); ++iter)
 	{
 		Easy* easy = *iter;
+		LL_CHECK_MEMORY
 		check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
-
+		LL_CHECK_MEMORY
 		if(deleted)
 		{
 			easy->mResponder = NULL ; //avoid triggering mResponder.
+			LL_CHECK_MEMORY
 		}
 		delete easy;
+		LL_CHECK_MEMORY
 	}
 	mEasyActiveList.clear();
 	mEasyActiveMap.clear();
 	
-	// Clean up freed
+	LL_CHECK_MEMORY
+	
+		// Clean up freed
 	for_each(mEasyFreeList.begin(), mEasyFreeList.end(), DeletePointer());	
 	mEasyFreeList.clear();
-
+	
+	LL_CHECK_MEMORY
+		
 	check_curl_multi_code(LLCurl::deleteMultiHandle(mCurlMultiHandle));
 	mCurlMultiHandle = NULL ;
+
+	LL_CHECK_MEMORY
 	
 	delete mMutexp ;
 	mMutexp = NULL ;
+
+	LL_CHECK_MEMORY
+
 	delete mEasyMutexp ;
 	mEasyMutexp = NULL ;
 
+	LL_CHECK_MEMORY
+
 	mQueued = 0 ;
 	mState = STATE_COMPLETED;
 	
 								 S32 offset, S32 length,
 								 LLCurl::ResponderPtr responder)
 {
+	llassert(LLCurl::sNotQuitting);
 	LLCurl::Easy* easy = allocEasy();
 	if (!easy)
 	{
 						 const LLSD& data,
 						 LLCurl::ResponderPtr responder, S32 time_out)
 {
+	llassert(LLCurl::sNotQuitting);
 	LLCurl::Easy* easy = allocEasy();
 	if (!easy)
 	{
 						 const std::string& data,
 						 LLCurl::ResponderPtr responder, S32 time_out)
 {
+	llassert(LLCurl::sNotQuitting);
 	LLCurl::Easy* easy = allocEasy();
 	if (!easy)
 	{
 			break ;
 		}
 	}
+	LL_CHECK_MEMORY
 	sCurlThread->shutdown() ;
+	LL_CHECK_MEMORY
 	delete sCurlThread ;
 	sCurlThread = NULL ;
+	LL_CHECK_MEMORY
 
 #if SAFE_SSL
 	CRYPTO_set_locking_callback(NULL);
 	for_each(sSSLMutex.begin(), sSSLMutex.end(), DeletePointer());
 #endif
+	
+	LL_CHECK_MEMORY
 
 	for (std::set<CURL*>::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter)
 	{
 		CURL* curl = *iter;
 		LLCurl::deleteEasyHandle(curl);
 	}
+	
+	LL_CHECK_MEMORY
 
 	Easy::sFreeHandles.clear();
 
+	LL_CHECK_MEMORY
+
 	delete Easy::sHandleMutexp ;
 	Easy::sHandleMutexp = NULL ;
 
+	LL_CHECK_MEMORY
+
 	delete sHandleMutexp ;
 	sHandleMutexp = NULL ;
 
+	LL_CHECK_MEMORY
+
 	// removed as per https://jira.secondlife.com/browse/SH-3115
 	//llassert(Easy::sActiveHandles.empty());
 }
 //static 
 CURLM* LLCurl::newMultiHandle()
 {
+	llassert(sNotQuitting);
+
 	LLMutexLock lock(sHandleMutexp) ;
 
 	if(sTotalHandles + 1 > sMaxHandles)
 //static 
 CURL*  LLCurl::newEasyHandle()
 {
+	llassert(sNotQuitting);
 	LLMutexLock lock(sHandleMutexp) ;
 
 	if(sTotalHandles + 1 > sMaxHandles)
 	if(handle)
 	{
 		LLMutexLock lock(sHandleMutexp) ;
+		LL_CHECK_MEMORY
 		curl_easy_cleanup(handle) ;
+		LL_CHECK_MEMORY
 		sTotalHandles-- ;
 	}
 }

indra/llmessage/llcurl.h

 #include "llthread.h"
 #include "llqueuedthread.h"
 #include "llframetimer.h"
+#include "llpointer.h"
+
 
 class LLMutex;
 class LLCurlThread;
 		F64 mSpeedDownload;
 	};
 	
-	class Responder
+	class Responder : public LLThreadSafeRefCount
 	{
 	//LOG_CLASS(Responder);
 	public:
 				return false;
 			}
 
-	public: /* but not really -- don't touch this */
-		U32 mReferenceCount;
-
 	private:
 		std::string mURL;
 	};
-	typedef boost::intrusive_ptr<Responder>	ResponderPtr;
+	typedef LLPointer<Responder>	ResponderPtr;
 
 
 	/**
 	void cleanupMulti(LLCurl::Multi* multi) ;
 } ;
 
-namespace boost
-{
-	void intrusive_ptr_add_ref(LLCurl::Responder* p);
-	void intrusive_ptr_release(LLCurl::Responder* p);
-};
-
 
 class LLCurlRequest
 {
Add a comment to this file

indra/llmessage/llurlrequest.cpp

File contents unchanged.

indra/llmessage/tests/llcurl_stub.cpp

 #include "llcurl.h"
 
 LLCurl::Responder::Responder()
-	: mReferenceCount(0)
 {
 }
 
 {
 }
 
-namespace boost
-{
-	void intrusive_ptr_add_ref(LLCurl::Responder* p)
-	{
-		++p->mReferenceCount;
-	}
-
-	void intrusive_ptr_release(LLCurl::Responder* p)
-	{
-		if(p && 0 == --p->mReferenceCount)
-		{
-			delete p;
-		}
-	}
-};
-

indra/llmessage/tests/llhttpclient_test.cpp

 			}
 		
 		public:
-			static boost::intrusive_ptr<Result> build(HTTPClientTestData& client)
+			static Result* build(HTTPClientTestData& client)
 			{
-				return boost::intrusive_ptr<Result>(new Result(client));
+				return new Result(client);
 			}
 			
 			~Result()
 	void HTTPClientTestObject::test<1>()
 	{
 		LLHTTPClient::get(local_server, newResult());
-
 		runThePump();
 		ensureStatusOK();
 		ensure("result object wasn't destroyed", mResultDeleted);

indra/llplugin/llpluginclassmedia.cpp

 			mAuthURL = message.getValue("url");
 			mAuthRealm = message.getValue("realm");
 			mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_AUTH_REQUEST);
-		}		
+		}
 		else if(message_name == "debug_message")
 		{
 			mDebugMessageText = message.getValue("message_text");
Add a comment to this file

indra/llprimitive/llmodel.cpp

File contents unchanged.

Add a comment to this file

indra/llrender/llimagegl.cpp

File contents unchanged.

Add a comment to this file

indra/llrender/llrendertarget.cpp

File contents unchanged.

Add a comment to this file

indra/llrender/llrendertarget.h

File contents unchanged.

indra/llrender/llvertexbuffer.cpp

 
 
 
-
 void LLVBOPool::cleanup()
 {
 	U32 size = LL_VBO_BLOCK_SIZE;

indra/newview/CMakeLists.txt

 if (WINDOWS)
     set_target_properties(${VIEWER_BINARY_NAME}
         PROPERTIES
+        # *TODO -reenable this once we get server usage sorted out
         LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS}"
         LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
         LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF"

indra/newview/llappviewer.cpp

 	sTextureFetch->shutDownTextureCacheThread() ;
 	sTextureFetch->shutDownImageDecodeThread() ;
 
+	llinfos << "Shutting down message system" << llendflush;
+	end_messaging_system();
+
+	// *NOTE:Mani - The following call is not thread safe. 
+	LL_CHECK_MEMORY
+	LLCurl::cleanupClass();
+	LL_CHECK_MEMORY
+
 	LLFilePickerThread::cleanupClass();
 
+	//MUST happen AFTER LLCurl::cleanupClass
 	delete sTextureCache;
     sTextureCache = NULL;
 	delete sTextureFetch;
 
 	LLViewerAssetStatsFF::cleanup();
 	
-	llinfos << "Shutting down message system" << llendflush;
-	end_messaging_system();
-
-	// *NOTE:Mani - The following call is not thread safe. 
-	LLCurl::cleanupClass();
-
 	// If we're exiting to launch an URL, do that here so the screen
 	// is at the right resolution before we launch IE.
 	if (!gLaunchFileOnQuit.empty())

indra/newview/llappviewerwin32.cpp

 	// Note: This won't work when running from the debugger unless the _NO_DEBUG_HEAP environment variable is set to 1
 
 	// Enable to get mem debugging within visual studio.
-	//_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+#if LL_DEBUG
+	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+#else
 	_CrtSetDbgFlag(0); // default, just making explicit
 	
 	ULONG ulEnableLFH = 2;
 			heap_enable_lfh_error[i] = GetLastError();
 	}
 #endif
+#endif
 	
 	// *FIX: global
 	gIconResource = MAKEINTRESOURCE(IDI_LL_ICON);

indra/newview/llassetuploadresponders.cpp

 	bool uploadConfirmationCallback(
 		const LLSD& notification,
 		const LLSD& response,
-		boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder> responder)
+		LLPointer<LLNewAgentInventoryVariablePriceResponder> responder)
 	{
 		S32 option;
 		std::string confirmation_url;
 
 	void confirmUpload(
 		const std::string& confirmation_url,
-		boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder> responder)
+		LLPointer<LLNewAgentInventoryVariablePriceResponder> responder)
 	{
 		if ( getFilename().empty() )
 		{
 		// and cause sadness.
 		mImpl->confirmUpload(
 			confirmation_url,
-			boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder>(this));
+			LLPointer<LLNewAgentInventoryVariablePriceResponder>(this));
 	}
 	else
 	{
 				mImpl,
 				_1,
 				_2,
-				boost::intrusive_ptr<LLNewAgentInventoryVariablePriceResponder>(this)));
+				LLPointer<LLNewAgentInventoryVariablePriceResponder>(this)));
 	}
 }
 

indra/newview/lldrawable.cpp

 
 void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
 {
+	//precondition: mSpatialGroupp MUST be null or DEAD or mSpatialGroupp MUST NOT contain this
+	llassert(!mSpatialGroupp || mSpatialGroupp->isDead() || !mSpatialGroupp->hasElement(this));
+
+	//precondition: groupp MUST be null or groupp MUST contain this
+	llassert(!groupp || groupp->hasElement(this));
+
 /*if (mSpatialGroupp && (groupp != mSpatialGroupp))
 	{
 		mSpatialGroupp->setState(LLSpatialGroup::GEOM_DIRTY);
 		}
 	}
 
+	//postcondition: if next group is NULL, previous group must be dead OR NULL OR binIndex must be -1
+	//postcondition: if next group is NOT NULL, binIndex must not be -1
+	llassert(groupp == NULL ? (mSpatialGroupp == NULL || mSpatialGroupp->isDead()) || getBinIndex() == -1 :
+							getBinIndex() != -1);
+
 	mSpatialGroupp = groupp;
-
-	llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
 }
 
 LLSpatialPartition* LLDrawable::getSpatialPartition()
 		markDead();
 		return;
 	}
-	
+
 	if (gShiftFrame)
 	{
 		return;
 	LLDrawable::cleanupReferences();
 	if (mDrawable)
 	{
-		LLSpatialGroup* group = mDrawable->getSpatialGroup();
-		if (group)
-		{
-			group->mOctreeNode->remove(mDrawable);
-			mDrawable->setSpatialGroup(NULL);
-		}
+		/*
 		
+		DON'T DO THIS -- this should happen through octree destruction
+
+		mDrawable->setSpatialGroup(NULL);
 		if (mDrawable->getVObj())
 		{
 			LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
 				LLDrawable* drawable = child->mDrawable;					
 				if (drawable)
 				{
-					LLSpatialGroup* group = drawable->getSpatialGroup();
-					if (group)
-					{
-						group->mOctreeNode->remove(drawable);
-						drawable->setSpatialGroup(NULL);
-					}
+					drawable->setSpatialGroup(NULL);
 				}
 			}
-		}
+		}*/
 
 		LLDrawable* drawablep = mDrawable;
 		mDrawable = NULL;
Add a comment to this file

indra/newview/lldrawable.h

File contents unchanged.

Add a comment to this file

indra/newview/lldrawpool.cpp

File contents unchanged.

Add a comment to this file

indra/newview/lldrawpool.h

File contents unchanged.

indra/newview/lldrawpoolalpha.cpp

 					continue;
 				}
 
-				if ((params.mVertexBuffer->getTypeMask() & mask) != mask)
-				{ //FIXME!
-					llwarns << "Missing required components, skipping render batch." << llendl;
-					continue;
-				}
-
 				LLRenderPass::applyModelMatrix(params);
 
 				
Add a comment to this file

indra/newview/lldrawpoolavatar.cpp

File contents unchanged.

Add a comment to this file

indra/newview/lldrawpoolbump.cpp

File contents unchanged.

Add a comment to this file

indra/newview/lldrawpoolterrain.cpp

File contents unchanged.

Add a comment to this file

indra/newview/lldrawpoolterrain.h

File contents unchanged.

Add a comment to this file

indra/newview/lldrawpooltree.cpp

File contents unchanged.

Add a comment to this file

indra/newview/lldriverparam.cpp

File contents unchanged.

indra/newview/lldriverparam.h

 	LLDriverParam(LLWearable *wearablep);
 	~LLDriverParam();
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	// Special: These functions are overridden by child classes
 	LLDriverParamInfo*		getInfo() const { return (LLDriverParamInfo*)mInfo; }
 	//   This sets mInfo and calls initialization functions
Add a comment to this file

indra/newview/lldynamictexture.h

File contents unchanged.

indra/newview/lleventpoll.cpp

 
 	class LLEventPollEventTimer : public LLEventTimer
 	{
-		typedef boost::intrusive_ptr<LLEventPollResponder> EventPollResponderPtr;
+		typedef LLPointer<LLEventPollResponder> EventPollResponderPtr;
 
 	public:
 		LLEventPollEventTimer(F32 period, EventPollResponderPtr responder)

indra/newview/llface.cpp

 
 	//special value to indicate uninitialized position
 	mIndicesIndex	= 0xFFFFFFFF;
-
+	
+	mIndexInTex = 0;
 	mTexture		= NULL;
 	mTEOffset		= -1;
 	mTextureIndex = 255;

File contents unchanged.

Add a comment to this file

indra/newview/llflexibleobject.cpp

File contents unchanged.

Add a comment to this file

indra/newview/llflexibleobject.h

File contents unchanged.

indra/newview/llfloaterbuycontents.cpp

 
 		BOOL item_is_multi = FALSE;
 		if ((inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED
-		     || inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
-		     && !(inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK))
+			|| inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
+			&& !(inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK))
 		{
 			item_is_multi = TRUE;
 		}
Add a comment to this file

indra/newview/llfloaterland.cpp

File contents unchanged.

Add a comment to this file

indra/newview/llfloatermodelpreview.cpp

File contents unchanged.

indra/newview/llfloaterpathfindinglinksets.cpp

 	mLabelSuggestedUseD(NULL),
 	mEditD(NULL),
 	mApplyEditsButton(NULL),
-	mBeaconColor()
+	mBeaconColor(),
+	mPreviousValueA(LLPathfindingLinkset::MAX_WALKABILITY_VALUE),
+	mPreviousValueB(LLPathfindingLinkset::MAX_WALKABILITY_VALUE),
+	mPreviousValueC(LLPathfindingLinkset::MAX_WALKABILITY_VALUE),
+	mPreviousValueD(LLPathfindingLinkset::MAX_WALKABILITY_VALUE)
 {
 }
 
 	mEditA = findChild<LLLineEditor>("edit_a_value");
 	llassert(mEditA != NULL);
 	mEditA->setPrevalidate(LLTextValidate::validateNonNegativeS32);
-	mEditA->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
+	mEditA->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueA));
 
 	mLabelEditB = findChild<LLTextBase>("edit_b_label");
 	llassert(mLabelEditB != NULL);
 	mEditB = findChild<LLLineEditor>("edit_b_value");
 	llassert(mEditB != NULL);
 	mEditB->setPrevalidate(LLTextValidate::validateNonNegativeS32);
-	mEditB->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
+	mEditB->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueB));
 
 	mLabelEditC = findChild<LLTextBase>("edit_c_label");
 	llassert(mLabelEditC != NULL);
 	mEditC = findChild<LLLineEditor>("edit_c_value");
 	llassert(mEditC != NULL);
 	mEditC->setPrevalidate(LLTextValidate::validateNonNegativeS32);
-	mEditC->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
+	mEditC->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueC));
 
 	mLabelEditD = findChild<LLTextBase>("edit_d_label");
 	llassert(mLabelEditD != NULL);
 	mEditD = findChild<LLLineEditor>("edit_d_value");
 	llassert(mEditD != NULL);
 	mEditD->setPrevalidate(LLTextValidate::validateNonNegativeS32);
-	mEditD->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
+	mEditD->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueD));
 
 	mApplyEditsButton = findChild<LLButton>("apply_edit_values");
 	llassert(mApplyEditsButton != NULL);
 	rebuildObjectsScrollList();
 }
 
-void LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl)
+void LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl, LLSD &pPreviousValue)
 {
 	LLLineEditor *pLineEditor = static_cast<LLLineEditor *>(pUICtrl);
 	llassert(pLineEditor != NULL);
 
 	const std::string &valueString = pLineEditor->getText();
-	S32 value;
 
-	if (LLStringUtil::convertToS32(valueString, value))
+	S32 intValue;
+	LLSD value;
+	bool doResetValue = false;
+
+	if (valueString.empty())
 	{
-		if ((value < LLPathfindingLinkset::MIN_WALKABILITY_VALUE) || (value > LLPathfindingLinkset::MAX_WALKABILITY_VALUE))
-		{
-			value = llclamp(value, LLPathfindingLinkset::MIN_WALKABILITY_VALUE, LLPathfindingLinkset::MAX_WALKABILITY_VALUE);
-			pLineEditor->setValue(LLSD(value));
-		}
+		value = pPreviousValue;
+		doResetValue = true;
+	}
+	else if (LLStringUtil::convertToS32(valueString, intValue))
+	{
+		doResetValue = ((intValue < LLPathfindingLinkset::MIN_WALKABILITY_VALUE) || (intValue > LLPathfindingLinkset::MAX_WALKABILITY_VALUE));
+		value = LLSD(llclamp(intValue, LLPathfindingLinkset::MIN_WALKABILITY_VALUE, LLPathfindingLinkset::MAX_WALKABILITY_VALUE));
 	}
 	else
 	{
-		pLineEditor->setValue(LLSD(LLPathfindingLinkset::MAX_WALKABILITY_VALUE));
+		value = LLSD(LLPathfindingLinkset::MAX_WALKABILITY_VALUE);
+		doResetValue = true;
 	}
+
+	if (doResetValue)
+	{
+		pLineEditor->setValue(value);
+	}
+	pPreviousValue = value;
 }
 
 void LLFloaterPathfindingLinksets::onApplyChangesClicked()
 		const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(firstSelectedObjectPtr.get());
 
 		setEditLinksetUse(linkset->getLinksetUse());
-		mEditA->setValue(LLSD(linkset->getWalkabilityCoefficientA()));
-		mEditB->setValue(LLSD(linkset->getWalkabilityCoefficientB()));
-		mEditC->setValue(LLSD(linkset->getWalkabilityCoefficientC()));
-		mEditD->setValue(LLSD(linkset->getWalkabilityCoefficientD()));
+		mPreviousValueA = LLSD(linkset->getWalkabilityCoefficientA());
+		mPreviousValueB = LLSD(linkset->getWalkabilityCoefficientB());
+		mPreviousValueC = LLSD(linkset->getWalkabilityCoefficientC());
+		mPreviousValueD = LLSD(linkset->getWalkabilityCoefficientD());
+		mEditA->setValue(mPreviousValueA);
+		mEditB->setValue(mPreviousValueB);
+		mEditC->setValue(mPreviousValueC);
+		mEditD->setValue(mPreviousValueD);
 	}
 }
 

indra/newview/llfloaterpathfindinglinksets.h

 
 	void onApplyAllFilters();
 	void onClearFiltersClicked();
-	void onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl);
+	void onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl, LLSD &pPreviousValue);
 	void onApplyChangesClicked();
 
 	void clearFilters();
 	LLButton         *mApplyEditsButton;
 
 	LLColor4         mBeaconColor;
+
+	LLSD             mPreviousValueA;
+	LLSD             mPreviousValueB;
+	LLSD             mPreviousValueC;
+	LLSD             mPreviousValueD;
 };
 
 #endif // LL_LLFLOATERPATHFINDINGLINKSETS_H

indra/newview/llfloatertos.cpp

 
 	public:
 
-		static boost::intrusive_ptr< LLIamHere > build( LLFloaterTOS* parent )
+		static LLIamHere* build( LLFloaterTOS* parent )
 		{
-			return boost::intrusive_ptr< LLIamHere >( new LLIamHere( parent ) );
+			return new LLIamHere( parent );
 		};
 		
 		virtual void  setParent( LLFloaterTOS* parentIn )
 
 // this is global and not a class member to keep crud out of the header file
 namespace {
-	boost::intrusive_ptr< LLIamHere > gResponsePtr = 0;
+	LLPointer< LLIamHere > gResponsePtr = 0;
 };
 
 BOOL LLFloaterTOS::postBuild()

indra/newview/llfolderview.cpp

 		mDebugFilters = debug_filters;
 		arrangeAll();
 	}
-
 	BOOL filter_modified_and_active = mFilter->isModified() && mFilter->isNotDefault();
 	mNeedsAutoSelect = filter_modified_and_active &&
 						!(gFocusMgr.childHasKeyboardFocus(this) || gFocusMgr.getMouseCapture());
 	mFilter->clearModified();
-			
+
 	// filter to determine visibility before arranging
 	filterFromRoot();
 

indra/newview/llpanelmarketplaceinbox.cpp

 	if (sidepanel_inventory)
 	{
 		sidepanel_inventory->clearSelections(true, false);
-	}
-
+		}
+	
 	gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
 }
 
 				if (inbox_item_view && inbox_item_view->isFresh())
 				{
 					fresh_item_count++;
-				}
-			}
+		}
+	}
 		}
 	}
 
Add a comment to this file

indra/newview/llphysicsmotion.cpp

File contents unchanged.

indra/newview/llpolymesh.cpp

 			mBaseNormals[i].clear();
 			mBaseBinormals[i].clear();
 			mTexCoords[i].clear();
-            mWeights[i] = 0.f;
+			mWeights[i] = 0.f;
         }
         mNumVertices = numVertices;
         return TRUE;

indra/newview/llpolymesh.h

 	LLPolySkeletalDistortion(LLVOAvatar *avatarp);
 	~LLPolySkeletalDistortion();
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	// Special: These functions are overridden by child classes
 	LLPolySkeletalDistortionInfo*	getInfo() const { return (LLPolySkeletalDistortionInfo*)mInfo; }
 	//   This sets mInfo and calls initialization functions

indra/newview/llpolymorph.cpp

 {
 	const S32 numVertices = mNumIndices;
 
-	mCoords = new LLVector4a[numVertices];
-	mNormals = new LLVector4a[numVertices];
-	mBinormals = new LLVector4a[numVertices];
+	mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
+	mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
+	mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
 	mTexCoords = new LLVector2[numVertices];
 	mVertexIndices = new U32[numVertices];
 	
 	}
 }
 
-
 //-----------------------------------------------------------------------------
 // ~LLPolyMorphData()
 //-----------------------------------------------------------------------------
 LLPolyMorphData::~LLPolyMorphData()
 {
-	delete [] mVertexIndices;
-	delete [] mCoords;
-	delete [] mNormals;
-	delete [] mBinormals;
-	delete [] mTexCoords;
+	freeData();
 }
 
 //-----------------------------------------------------------------------------
 	}
 
 	//-------------------------------------------------------------------------
+	// free any existing data
+	//-------------------------------------------------------------------------
+	freeData();
+
+	//-------------------------------------------------------------------------
 	// allocate vertices
 	//-------------------------------------------------------------------------
-	mCoords = new LLVector4a[numVertices];
-	mNormals = new LLVector4a[numVertices];
-	mBinormals = new LLVector4a[numVertices];
+	mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
+	mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
+	mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
 	mTexCoords = new LLVector2[numVertices];
 	// Actually, we are allocating more space than we need for the skiplist
 	mVertexIndices = new U32[numVertices];
 }
 
 //-----------------------------------------------------------------------------
+// freeData()
+//-----------------------------------------------------------------------------
+void LLPolyMorphData::freeData()
+{
+	if (mCoords != NULL)
+	{
+		ll_aligned_free_16(mCoords);
+		mCoords = NULL;
+	}
+
+	if (mNormals != NULL)
+	{
+		ll_aligned_free_16(mNormals);
+		mNormals = NULL;
+	}
+
+	if (mBinormals != NULL)
+	{
+		ll_aligned_free_16(mBinormals);
+		mBinormals = NULL;
+	}
+
+	if (mTexCoords != NULL)
+	{
+		delete [] mTexCoords;
+		mTexCoords = NULL;
+	}
+
+	if (mVertexIndices != NULL)
+	{
+		delete [] mVertexIndices;
+		mVertexIndices = NULL;
+	}
+}
+
+//-----------------------------------------------------------------------------
 // LLPolyMorphTargetInfo()
 //-----------------------------------------------------------------------------
 LLPolyMorphTargetInfo::LLPolyMorphTargetInfo()

indra/newview/llpolymorph.h

 	~LLPolyMorphData();
 	LLPolyMorphData(const LLPolyMorphData &rhs);
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	BOOL			loadBinary(LLFILE* fp, LLPolyMeshSharedData *mesh);
 	const std::string& getName() { return mName; }
 
 	F32					mMaxDistortion;		// maximum single vertex distortion in a given morph
 	LLVector4a			mAvgDistortion;		// average vertex distortion, to infer directionality of the morph
 	LLPolyMeshSharedData*	mMesh;
+
+private:
+	void freeData();
 };
 
 //-----------------------------------------------------------------------------
Add a comment to this file

indra/newview/llsidepaneliteminfo.cpp

File contents unchanged.

indra/newview/llspatialpartition.cpp

 		drawablep->setSpatialGroup(NULL);
 	}
 
+	drawablep->setSpatialGroup(NULL);
+
 	assert_octree_valid(mOctree);
 	
 	return TRUE;
 						{
 							if (index < 255)
 							{
-								if (facep->mDrawInfo->mTextureList.size()<= index)
+								if (facep->mDrawInfo->mTextureList.size() <= index)
 								{
 									llerrs << "Face texture index out of bounds." << llendl;
 								}

indra/newview/llspatialpartition.h

 	element_list& getData() { return mOctreeNode->getData(); }
 	element_iter getDataBegin() { return mOctreeNode->getDataBegin(); }
 	element_iter getDataEnd() { return mOctreeNode->getDataEnd(); }
+	bool hasElement(LLDrawable* drawablep) { return std::find(mOctreeNode->getDataBegin(), mOctreeNode->getDataEnd(), drawablep) != mOctreeNode->getDataEnd(); }
+
 	U32 getElementCount() const { return mOctreeNode->getElementCount(); }
 	bool isEmpty() const { return mOctreeNode->isEmpty(); }
 
Add a comment to this file

indra/newview/llsurface.cpp

File contents unchanged.

Add a comment to this file

indra/newview/llsurfacepatch.cpp

File contents unchanged.

indra/newview/lltexlayer.cpp

 			BOOL valid = FALSE;
 			LLPointer<LLImageJ2C> integrity_test = new LLImageJ2C;
 			S32 file_size = 0;
-			U8* data = LLVFile::readFile(gVFS, asset_id, LLAssetType::AT_TEXTURE, &file_size);
+			
+			//data buffer MUST be allocated using LLImageBase
+			LLVFile file(gVFS, asset_id, LLAssetType::AT_TEXTURE);
+			file_size = file.getSize();
+			U8* data = integrity_test->allocateData(file_size);
+			file.read(data, file_size);
+			
 			if (data)
 			{
 				valid = integrity_test->validate(data, file_size); // integrity_test will delete 'data'

indra/newview/lltexlayerparams.h

 
 	/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	// LLVisualParam Virtual functions
 	///*virtual*/ BOOL		parseData(LLXmlTreeNode* node);
 	/*virtual*/ void		apply( ESex avatar_sex ) {}
 	LLTexLayerParamColor( LLVOAvatar* avatar );
 	/* virtual */ ~LLTexLayerParamColor();
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
 
 	// LLVisualParam Virtual functions

indra/newview/lltexturefetch.cpp

         
         ~lcl_responder()
             {
+				LL_CHECK_MEMORY
                 mFetcher->decrCurlPOSTCount();
+				LL_CHECK_MEMORY
             }
 
 		// virtual

indra/newview/lltranslate.h

 		EService mService;
 	};
 
-	typedef boost::intrusive_ptr<TranslationReceiver> TranslationReceiverPtr;
-	typedef boost::intrusive_ptr<KeyVerificationReceiver> KeyVerificationReceiverPtr;
+	typedef LLPointer<TranslationReceiver> TranslationReceiverPtr;
+	typedef LLPointer<KeyVerificationReceiver> KeyVerificationReceiverPtr;
 
 	/**
 	 * Translate given text.
Add a comment to this file

indra/newview/llviewercamera.h

File contents unchanged.

Add a comment to this file

indra/newview/llviewerdisplay.cpp

File contents unchanged.