Function threadSafeAllocator [src]
Provides a lock free thread safe Allocator interface to the underlying FixedBufferAllocator
Using this at the same time as the interface returned by allocator is not thread safe.
Prototype
pub fn threadSafeAllocator(self: *FixedBufferAllocator) Allocator
Parameters
self: *FixedBufferAllocator
Source
pub fn threadSafeAllocator(self: *FixedBufferAllocator) Allocator {
return .{
.ptr = self,
.vtable = &.{
.alloc = threadSafeAlloc,
.resize = Allocator.noResize,
.remap = Allocator.noRemap,
.free = Allocator.noFree,
},
};
}