Open crazydef opened 1 year ago
I have proposed removing this macro in https://github.com/KhronosGroup/glslang/pull/3387 in an attempt to make the usage of the pool allocator more obvious in the code.
The thread pool allocator is used for allocation correctness because of the way the compiler works: while processing a compilation unit, a densely-interlinked object graph is allocated and used to keep track of variables, expressions, types, etc and then when compilation is done it's all deallocated with a single pop()
call. In the end the pool allocator delegates to the global operator new[]
and operator delete[]
for managing the underlying memory.
Without an easy way to disable this macro/these operators, it's very hard to provide a custom memory manager to glslang.
It would be nice if this could be disabled with a build switch.