Class ThreadLocalStack<E>


  • public class ThreadLocalStack<E>
    extends Object
    A thread local stack data structure. In order to avoid memory churn the underlying ArrayDeque is never freed. If we remove the deque when it is empty then this results in excessive deque allocations.
    • Constructor Detail

      • ThreadLocalStack

        public ThreadLocalStack()
    • Method Detail

      • push

        public void push​(E item)
      • peek

        public E peek()
      • pop

        public E pop()
      • isEmpty

        public boolean isEmpty()