Memory: remove a part of the last merge request that causes crashes in multi-threaded mode.
This commit is contained in:
parent
3e9add360d
commit
28ad350b35
@ -847,9 +847,7 @@ class TIntermAggregate : public TIntermOperator {
|
|||||||
public:
|
public:
|
||||||
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { }
|
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { }
|
||||||
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { }
|
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { }
|
||||||
// Since pragmaTable is allocated with the PoolAllocator, we
|
~TIntermAggregate() { delete pragmaTable; }
|
||||||
// only want to destroy it, not free the associated memory.
|
|
||||||
~TIntermAggregate() { pragmaTable->~TPragmaTable(); }
|
|
||||||
virtual TIntermAggregate* getAsAggregate() { return this; }
|
virtual TIntermAggregate* getAsAggregate() { return this; }
|
||||||
virtual const TIntermAggregate* getAsAggregate() const { return this; }
|
virtual const TIntermAggregate* getAsAggregate() const { return this; }
|
||||||
virtual void setOperator(TOperator o) { op = o; }
|
virtual void setOperator(TOperator o) { op = o; }
|
||||||
|
|||||||
@ -1613,13 +1613,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||||||
void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable)
|
void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable)
|
||||||
{
|
{
|
||||||
assert(!pragmaTable);
|
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;
|
*pragmaTable = pTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user