Struct MemoryResource

Inheritance Relationships

Derived Types

Struct Documentation

struct MemoryResource

C++17-style memory_resource base class. See http://en.cppreference.com/w/cpp/experimental/memory_resource

Subclassed by c4::MemoryResourceCounts, c4::MemoryResourceMalloc, c4::detail::DerivedMemoryResource

Public Functions

inline virtual ~MemoryResource()
inline void *allocate(size_t sz, size_t alignment = alignof(max_align_t), void *hint = nullptr)
inline void *reallocate(void *ptr, size_t oldsz, size_t newsz, size_t alignment = alignof(max_align_t))
inline void deallocate(void *ptr, size_t sz, size_t alignment = alignof(max_align_t))

Public Members

const char *name = nullptr

Protected Functions

virtual void *do_allocate(size_t sz, size_t alignment, void *hint) = 0
virtual void *do_reallocate(void *ptr, size_t oldsz, size_t newsz, size_t alignment) = 0
virtual void do_deallocate(void *ptr, size_t sz, size_t alignment) = 0