Exemplo n.º 1
0
	void LTMemDisableStackTracking()
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->DisableStackTracking();
		}
	}
Exemplo n.º 2
0
	//function that allows for pushing the context data onto the stack
	void LTMemPopMemoryContext()
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->PopMemoryContext();
		}
	}
Exemplo n.º 3
0
	void LTMemExternalFree(uint32 nMemCategory, uint32 nSize, void *pMemory)
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->FreeExternalAllocation(nMemCategory, nSize, pMemory);
		}
	}
Exemplo n.º 4
0
	void LTMemOnExit()
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->OnExit();
		}
	}
Exemplo n.º 5
0
	//function that allows for pushing the context data onto the stack
	void LTMemPushMemoryContext(const char* pszFile, uint32 nLine, uint32 nCategoryID)
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->PushMemoryContext(pszFile, nLine, nCategoryID);
		}
	}
Exemplo n.º 6
0
	//This will provide access to the ILTMemory interface.
	ILTMemory*	LTMemGetILTMemory()
	{
		if(VerifyMemoryInterface())
		{
			return g_pILTMemory;
		}
		return NULL;
	}
Exemplo n.º 7
0
	void* operator new[] (size_t nSize)
	{
		if(VerifyMemoryInterface())
		{
			return g_pILTMemory->Allocate((uint32)nSize);
		}

		//no memory interface available, just allocate the data
		return malloc(nSize);
	}
Exemplo n.º 8
0
	//matching delete for our tracked allocator
	void operator delete (void* pData, const char* pszFile, uint32 nLine, uint32 nAllocType)
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->Free(pData);
			return;
		}

		free(pData);
	}
Exemplo n.º 9
0
	//overload operator delete
	void operator delete(void* pData)
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->Free(pData);
			return;
		}

		free(pData);
	}
Exemplo n.º 10
0
	//overload operator delete
	void operator delete[](void* pData)
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->Free(pData);
			return;
		}

		//no memory interface available, just allocate the data
		free(pData);
	}
Exemplo n.º 11
0
	//operator new that also tracks where the memory was allocated from
	void* operator new (size_t nSize, const char* pszFile, uint32 nLine, uint32 nAllocType)
	{
		if(VerifyMemoryInterface())
		{
			g_pILTMemory->SetAllocInfo(pszFile, nLine, nAllocType);
			void* pRV = g_pILTMemory->Allocate(nSize);
			g_pILTMemory->ReleaseAllocInfo();

			return pRV;
		}

		return malloc(nSize);
	}
Exemplo n.º 12
0
	//overload operator new
	void* operator new (size_t nSize)
	{
		if(VerifyMemoryInterface())
		{
			//we have a call to new that did not go through debug new, at least filter it
			//into the appropriate game code section
			g_pILTMemory->SetAllocInfo(__FILE__, __LINE__, LT_MEM_TYPE_UNKNOWN);
			void* pRV = g_pILTMemory->Allocate(nSize);
			g_pILTMemory->ReleaseAllocInfo();

			return pRV;
		}

		return malloc(nSize);
	}