FreeList

Free list class template.

Members

Aliases

ItemType
alias ItemType = ItemType_!(T)

Alias for item type to be stored in free list and accepted by public methods.

Functions

fill
typeof(this) fill(size_t num, ItemType new_item)

Ensures that the free list contains at least the specified number of (idle) items. Useful to pre-allocate a free list of a certain size.

get
ItemType get(ItemType new_item)

Gets an item from the free list.

minimize
typeof(this) minimize(size_t num)

Ensures that the free list contains at most the specified number of (idle) items.

num_idle
size_t num_idle()
recycle
void recycle(ItemType item)

Recycles an item into the free list.

Parameters

T

item type to be stored in free list

Meta