19 struct alignas(2 * sizeof(Node*))
PTag
58 if (
mTop.compare_exchange_weak(
old_top,
new_top, std::memory_order_acquire, std::memory_order_relaxed))
79 if (
mTop.compare_exchange_weak(
old_top,
new_top, std::memory_order_acquire, std::memory_order_relaxed))
Atomic, unbounded LIFO stack with lock-free push and pop operations.
Definition Stack.hpp:17
Allocator * mAlloc
Definition Stack.hpp:30
Atomic< PTag > mTop
Definition Stack.hpp:29
void Push(U &&value)
Push a value onto the stack.
Definition Stack.hpp:44
Stack(Allocator *alloc)
Construct the Stack.
Definition Stack.hpp:36
bool Pop(T &out)
Pop a value from the stack.
Definition Stack.hpp:72
General Purpose Allocator (GPA) interface.
Definition Allocator.hpp:24
virtual void Deallocate(pointer ptr, size_type size)=0
virtual pointer Allocate(size_type size, size_t alignment=alignof(std::max_align_t))=0
Lock-free atomic primitives and implementations of data structures.
Definition Atomic.hpp:22
Allocators, Data Structures and introspection implementations.
Definition Allocator.hpp:5
std::unique_ptr< T, StlDeleter< T > > UniquePtr
std::unique_ptr with custom deleter that uses a Foundation::Core::Allocator to deallocate memory.
Definition Allocator.hpp:161
PTag next
Definition Stack.hpp:26
T data
Definition Stack.hpp:27
uintptr_t tag
Definition Stack.hpp:22
Node * p
Definition Stack.hpp:21