Free memory associated with SPIR-V generation.

This commit is contained in:
Andrew Woloszyn 2016-01-18 09:23:56 -05:00
parent 863aa667f3
commit b7946d16bb
5 changed files with 109 additions and 93 deletions

View file

@ -1613,7 +1613,13 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable)
{
assert(!pragmaTable);
pragmaTable = new TPragmaTable();
// We allocate this with the thread-pool allocator because the destructors
// for TIntermNode's are never called. When TIntermNodes are no longer
// needed, the pool allocator destroys all memory at once without
// destruction.
void* memory = GetThreadPoolAllocator().allocate(sizeof(TPragmaTable));
pragmaTable = new(memory) TPragmaTable();
*pragmaTable = pTable;
}