#include <simple_allocator.h>
Public Member Functions | |
LinkedRegionTracker (SimpleAllocator &parent, ByteSpan region) | |
LinkedRegionTracker (const LinkedRegionTracker &)=delete | |
LinkedRegionTracker & | operator= (const LinkedRegionTracker &)=delete |
LinkedRegionTracker (LinkedRegionTracker &&)=delete | |
LinkedRegionTracker & | operator= (LinkedRegionTracker &&)=delete |
![]() | |
std::optional< OwnedChunk > | CreateFirstChunk () |
Protected Member Functions | |
void | Destroy () final |
ByteSpan | Region () const final |
void * | AllocateChunkClass () final |
void | DeallocateChunkClass (void *) final |
Deallocates a pointer returned by AllocateChunkClass . | |
virtual void | Destroy ()=0 |
virtual ByteSpan | Region () const =0 |
virtual void * | AllocateChunkClass ()=0 |
virtual void | DeallocateChunkClass (void *)=0 |
Deallocates a pointer returned by AllocateChunkClass . | |
![]() | |
constexpr | Item ()=default |
Friends | |
class | ::pw::multibuf::SimpleAllocator |
A ChunkRegionTracker
for the allocated regions within a SimpleAllocator
's data area.
|
finalprotectedvirtual |
Returns a pointer to sizeof(Chunk)
bytes with alignas(Chunk)
. Returns nullptr
on failure.
Implements pw::multibuf::ChunkRegionTracker.
|
finalprotectedvirtual |
Deallocates a pointer returned by AllocateChunkClass
.
Implements pw::multibuf::ChunkRegionTracker.
|
finalprotectedvirtual |
Destroys the ChunkRegionTracker
.
Typical implementations will call std::destroy_at(this)
and then free the memory associated with the region and the tracker.
Implements pw::multibuf::ChunkRegionTracker.
|
inlinefinalprotectedvirtual |
Returns the entire span of the region being managed.
Chunk
s referencing this tracker will not expand beyond this region, nor into one another's portions of the region.
This region does not provide any alignment guarantees by default.
This region must not change for the lifetime of this ChunkRegionTracker
.
Implements pw::multibuf::ChunkRegionTracker.