23 const void*
ptr()
const {
64 CommonAllocator() =
default;
Definition allocator.h:39
Allocator & operator=(const Allocator &other)=delete
virtual size_t size(Buffer buffer) const =0
Allocator & operator=(Allocator &&other)=delete
Allocator(Allocator &&other)=delete
virtual ~Allocator()=default
virtual Buffer malloc(size_t size, bool allow_swap=false)=0
Abstract base class for a memory allocator.
Allocator(const Allocator &other)=delete
virtual void free(Buffer buffer)=0
Definition allocator.h:12
const void * ptr() const
Definition allocator.h:23
Buffer(void *ptr)
Definition allocator.h:17
void * ptr()
Definition allocator.h:26
virtual Buffer malloc(size_t size, bool allow_swap=false) override
A general CPU allocator.
virtual void free(Buffer buffer) override
virtual size_t size(Buffer buffer) const override
friend Allocator & allocator()
Buffer malloc(size_t size)
Buffer malloc_or_wait(size_t size)