Struct MemoryResourceLinear

Inheritance Relationships

Base Type

Derived Type

Struct Documentation

struct MemoryResourceLinear : public c4::detail::_MemoryResourceSingleChunk

provides a linear memory resource. Allocates incrementally from a linear buffer, without ever deallocating. Deallocations are a no-op, and the memory is freed only when the resource is release()d. The memory used by this object can be either owned or borrowed. When borrowed, no calls to malloc/free take place.

Subclassed by c4::MemoryResourceLinearArr< N >

Public Functions

C4_NO_COPY_OR_MOVE(MemoryResourceLinear)

Protected Functions

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