Pigweed
 
Loading...
Searching...
No Matches
pw::multibuf::internal::LinkedRegionTracker Class Referencefinal

#include <simple_allocator.h>

Inheritance diagram for pw::multibuf::internal::LinkedRegionTracker:
pw::multibuf::ChunkRegionTracker pw::containers::future::IntrusiveList< T >::Item

Public Member Functions

 LinkedRegionTracker (SimpleAllocator &parent, ByteSpan region)
 
 LinkedRegionTracker (const LinkedRegionTracker &)=delete
 
LinkedRegionTrackeroperator= (const LinkedRegionTracker &)=delete
 
 LinkedRegionTracker (LinkedRegionTracker &&)=delete
 
LinkedRegionTrackeroperator= (LinkedRegionTracker &&)=delete
 
- Public Member Functions inherited from pw::multibuf::ChunkRegionTracker
std::optional< OwnedChunkCreateFirstChunk ()
 

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.
 
- Protected Member Functions inherited from pw::containers::future::IntrusiveList< T >::Item
constexpr Item ()=default
 

Friends

class ::pw::multibuf::SimpleAllocator
 

Detailed Description

A ChunkRegionTracker for the allocated regions within a SimpleAllocator's data area.

Member Function Documentation

◆ AllocateChunkClass()

void * pw::multibuf::internal::LinkedRegionTracker::AllocateChunkClass ( )
finalprotectedvirtual

Returns a pointer to sizeof(Chunk) bytes with alignas(Chunk). Returns nullptr on failure.

Implements pw::multibuf::ChunkRegionTracker.

◆ DeallocateChunkClass()

void pw::multibuf::internal::LinkedRegionTracker::DeallocateChunkClass ( void *  )
finalprotectedvirtual

Deallocates a pointer returned by AllocateChunkClass.

Implements pw::multibuf::ChunkRegionTracker.

◆ Destroy()

void pw::multibuf::internal::LinkedRegionTracker::Destroy ( )
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.

◆ Region()

ByteSpan pw::multibuf::internal::LinkedRegionTracker::Region ( ) const
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.


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