package core.alloc.atomic
AtomicAllocator wraps another allocator in a mutex, ensuring that every allocation is thread-safe. This is not needed for the general purpose heap allocator, as that already has a thread-safe implementation.
AtomicAllocator :: struct {
a: Allocator;
m: Mutex;
}
Stores internal details used by the atomic allocator.
Simply the wrapped allocator and the mutex.
atomic_alloc :: (atomic: &AtomicAllocator, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr
make :: (a: Allocator) -> AtomicAllocator
Creates a new AtomicAllocator over an existing allocator.