Enum redox_buffer_pool::AllocationStrategy[][src]

pub enum AllocationStrategy<I> {
    Optimal,
    Greedy,
    Fixed(I),
}
Expand description

The strategy to use when allocating, with tradeoffs between heap fragmentation, and the algorithmic complexity of allocating.

Variants

Optimal

Allocate as optimally as possible, by taking some extra time into making sure that the smallest range with the smallest alignment possible is used. This is currently O(1) in best case, but O(n) in worst case.

Greedy

Allocate as quickly as possible. This is currently implemented as a B-tree lookup in the free space map, so it’ll prioritize smaller ranges, and smaller alignments afterwards. This is O(log n) in best case, average case, and worst case.

Fixed(I)

Allocate at a fixed offset. Since this won’t cause the allocator to find a suitable range, but only check whether the range requested exists, this is also O(log n) in best case, average case, and worst case.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.