Interface and naming improvements:

- the new C++ style interface now stands on its own, with the addition of glslang::InitializeProcess() and glslang::FinalizeProcess()
 - more "global" pool names from a decade ago are fixed to be thread names
 - StandAlone.cpp fully uses one of the old-style interface or new C++ style interface


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23851 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-11-01 17:41:52 +00:00
parent 5b0f13acbc
commit c36e1d8e51
8 changed files with 57 additions and 26 deletions

View file

@ -42,17 +42,17 @@ namespace glslang {
OS_TLSIndex PoolIndex;
void InitializeGlobalPools()
void InitializeMemoryPools()
{
TThreadGlobalPools* globalPools = static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex));
if (globalPools)
TThreadMemoryPools* pools = static_cast<TThreadMemoryPools*>(OS_GetTLSValue(PoolIndex));
if (pools)
return;
TPoolAllocator *globalPoolAllocator = new TPoolAllocator();
TPoolAllocator *threadPoolAllocator = new TPoolAllocator();
TThreadGlobalPools* threadData = new TThreadGlobalPools();
TThreadMemoryPools* threadData = new TThreadMemoryPools();
threadData->globalPoolAllocator = globalPoolAllocator;
threadData->threadPoolAllocator = threadPoolAllocator;
OS_SetTLSValue(PoolIndex, threadData);
}
@ -60,7 +60,7 @@ void InitializeGlobalPools()
void FreeGlobalPools()
{
// Release the allocated memory for this thread.
TThreadGlobalPools* globalPools = static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex));
TThreadMemoryPools* globalPools = static_cast<TThreadMemoryPools*>(OS_GetTLSValue(PoolIndex));
if (! globalPools)
return;
@ -86,16 +86,16 @@ void FreePoolIndex()
TPoolAllocator& GetThreadPoolAllocator()
{
TThreadGlobalPools* threadData = static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex));
TThreadMemoryPools* threadData = static_cast<TThreadMemoryPools*>(OS_GetTLSValue(PoolIndex));
return *threadData->globalPoolAllocator;
return *threadData->threadPoolAllocator;
}
void SetThreadPoolAllocator(TPoolAllocator& poolAllocator)
{
TThreadGlobalPools* threadData = static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex));
TThreadMemoryPools* threadData = static_cast<TThreadMemoryPools*>(OS_GetTLSValue(PoolIndex));
threadData->globalPoolAllocator = &poolAllocator;
threadData->threadPoolAllocator = &poolAllocator;
}
//