Example #1
0
//
// Method that will query the correct memory pool of the calling
// thread for a set number of bytes.  Returns 0 if there was a
// failure in getting the memory.
//
LPSTR MemoryManager::CPP_GetTempMemory(int cByte)
{
	DWORD dwThreadID;
	MemoryPool* pmp;

	dwThreadID = GetCurrentThreadId(); //the id of the calling thread
	pmp = GetMemoryPool(dwThreadID);

	if (!pmp) //no more room for pools
	{
		return 0;
	}

	return pmp->GetTempMemory(cByte);
}