Helper type that creates a single OwnedChunk from a region of memory and mimics v1::SingleChunkRegionTracker.
This type can be used as a drop-in replacement for v1::SingleChunkRegionTracker while migrating to using pw_multibuf/v2.
Public Member Functions | |
| SingleChunkRegionTracker (ByteSpan region) | |
| std::optional< OwnedChunk > | GetChunk (size_t size) |
|
inline |
Gets a Chunk of a given size, which must be less than or equal to the provided region.
Returns: An OwnedChunk if the Chunk is free, otherwise std::nullopt, in which case GetChunk() can be called again.