41 [[nodiscard]]
bool isFree(std::
size_t blockIndex) const noexcept;
std::unique_ptr< Impl > impl_
Result< void > free(std::size_t blockIndex)
Frees a previously allocated block.
bool isFree(std::size_t blockIndex) const noexcept
Returns whether block is free.
BlockAllocator(std::size_t totalBlocks)
Creates a block allocator over a fixed number of blocks.
void reset()
Resets allocator state, marking every block as free.
Result< std::size_t > allocate()
Allocates one free block.
BlockAllocator(BlockAllocator &&) noexcept
std::size_t totalBlocks() const noexcept
Total number of blocks managed by allocator.
BlockAllocator(const BlockAllocator &)=delete
std::size_t freeBlocks() const noexcept
Number of currently free blocks.
BlockAllocator & operator=(const BlockAllocator &)=delete
A result type that holds either a success value of type T or an ErrorCode.
Error codes and Result<T> type for fallible operations.