19 struct alignas(2 * sizeof(Node*))
PTag
61 if (
mTop.compare_exchange_weak(
old_top,
new_top, std::memory_order_acquire, std::memory_order_relaxed))
81 if (
mTop.compare_exchange_weak(
old_top,
new_top, std::memory_order_acquire, std::memory_order_relaxed))
General Purpose Allocator (GPA) interface.
Definition Allocator.hpp:24
virtual void Deallocate(pointer ptr)=0
virtual pointer Allocate(size_type size, size_t alignment=alignof(std::max_align_t))=0
Atomic, unbounded LIFO stack with lock-free push and pop operations.
Definition AtomicStack.hpp:16
AtomicStack(Allocator *alloc)
Construct the Stack.
Definition AtomicStack.hpp:39
Atomic< PTag > mTop
Definition AtomicStack.hpp:31
bool Pop(T &out)
Pop a value from the stack.
Definition AtomicStack.hpp:74
void Push(U &&value)
Push a value onto the stack.
Definition AtomicStack.hpp:47
~AtomicStack()
Definition AtomicStack.hpp:91
Allocator * mAlloc
Definition AtomicStack.hpp:32
Lock-free atomic primitives and implementations of data structures.
Definition Allocator.hpp:5
std::atomic< T > Atomic
Alias of std::atomic<T>.
Definition Atomic.hpp:26
T * Construct(Allocator *resource, Args &&...args)
Convenience placement new with object of type T using a Foundation::Core::Allocator.
Definition Allocator.hpp:149
Definition AtomicStack.hpp:25
PTag next
Definition AtomicStack.hpp:26
T data
Definition AtomicStack.hpp:27
Definition AtomicStack.hpp:20
uintptr_t tag
Definition AtomicStack.hpp:22
Node * p
Definition AtomicStack.hpp:21