Pigweed
 
Loading...
Searching...
No Matches
pw::allocator::FastSortedBucket< BlockType > Class Template Reference

#include <fast_sorted.h>

Inheritance diagram for pw::allocator::FastSortedBucket< BlockType >:
pw::allocator::internal::BucketBase< FastSortedBucket< BlockType >, BlockType, FastSortedItem< BlockType > >

Friends

template<typename >
class ReverseFastSortedBucket
 

Additional Inherited Members

- Public Types inherited from pw::allocator::internal::BucketBase< FastSortedBucket< BlockType >, BlockType, FastSortedItem< BlockType > >
using BlockType = BlockType
 
using ItemType = FastSortedItem< BlockType >
 
- Public Member Functions inherited from pw::allocator::internal::BucketBase< FastSortedBucket< BlockType >, BlockType, FastSortedItem< BlockType > >
constexpr bool empty () const
 Returns whether this buckets contains any free blocks.
 
constexpr size_t max_inner_size () const
 Returns the configured maximum inner size for blocks in this bucket.
 
constexpr void set_max_inner_size (size_t max_inner_size)
 
bool Add (BlockType &block)
 
BlockType * RemoveAny ()
 
bool Remove (BlockType &block)
 
BlockType * RemoveCompatible (Layout layout)
 
void Clear ()
 Removes all blocks from this bucket.
 
constexpr BlockType * GetBlockFromIterator (Iterator iter, Iterator last)
 
constexpr BlockType * GetBlockFromPrev (Iterator prev, Iterator last)
 
- Static Public Member Functions inherited from pw::allocator::internal::BucketBase< FastSortedBucket< BlockType >, BlockType, FastSortedItem< BlockType > >
static Iterator FindPrevIf (Iterator before_first, Iterator last, Predicate predicate)
 
static auto MakeCanAllocPredicate (Layout layout)
 
- Static Protected Member Functions inherited from pw::allocator::internal::BucketBase< FastSortedBucket< BlockType >, BlockType, FastSortedItem< BlockType > >
static ItemTypeGetItemFrom (BlockType &block)
 

Detailed Description

template<typename BlockType>
class pw::allocator::FastSortedBucket< BlockType >

Container of size-sorted free blocks.

The container used to hold the blocks is a multimap. Insertion and removal are O(log(n)) operations. However, the multimap nodes require more space than the "compact" items. As such, this bucket type is a good general purpose container for items above a minimum size.


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