Flow
Documentation for the Flow C++ Library
Loading...
Searching...
No Matches
flow::MemoryResource Class Referenceabstract

A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and deallocate raw memory. More...

#include <flow_memory_resource.h>

Inheritance diagram for flow::MemoryResource:

Public Member Functions

virtual ~MemoryResource ()=default
void * allocate (std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
void deallocate (void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))

Protected Member Functions

virtual void * allocateImp (std::size_t bytes, std::size_t alignment)=0
virtual void deallocateImp (void *address, std::size_t bytes, std::size_t alignment)=0

Detailed Description

A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and deallocate raw memory.

Definition at line 9 of file flow_memory_resource.h.

Constructor & Destructor Documentation

◆ ~MemoryResource()

virtual flow::MemoryResource::~MemoryResource ( )
virtualdefault

Member Function Documentation

◆ allocate()

void * flow::MemoryResource::allocate ( std::size_t bytes,
std::size_t alignment = alignof(std::max_align_t) )
inline

Definition at line 13 of file flow_memory_resource.h.

13 {
14 return allocateImp(bytes, alignment);
15 }
virtual void * allocateImp(std::size_t bytes, std::size_t alignment)=0

References allocateImp().

◆ allocateImp()

virtual void * flow::MemoryResource::allocateImp ( std::size_t bytes,
std::size_t alignment )
protectedpure virtual

◆ deallocate()

void flow::MemoryResource::deallocate ( void * address,
std::size_t bytes,
std::size_t alignment = alignof(std::max_align_t) )
inline

Definition at line 17 of file flow_memory_resource.h.

17 {
18 deallocateImp(address, bytes, alignment);
19 }
virtual void deallocateImp(void *address, std::size_t bytes, std::size_t alignment)=0

References deallocateImp().

◆ deallocateImp()

virtual void flow::MemoryResource::deallocateImp ( void * address,
std::size_t bytes,
std::size_t alignment )
protectedpure virtual

The documentation for this class was generated from the following file: