Empty the stack.
Remove the item at the top of the stack.
Add an item to the stack.
Reset totalNodeCount back to 0.
This special field is only available when version Fluid_MemoryStatistics is set. Stack will then count the number of total nodes it has allocated per type and thread.
Implementation of a stack optimized to reduce allocations.
Removing nodes from the stack using pop or clear will move them to a global stack of "free" nodes. The next time an item is added to the stack, it will reuse one of these previously freed nodes. This recycling mechanism makes it possible to significantly reduce the number of allocations as the program continues.
If version Fluid_MemoryStatistics is set, Stack will count the number of total nodes it has allocated per type and thread and expose then through totalNodeCount.