pub struct GlobalAllocAsFlexSource<T, const ALIGN: usize>(pub T);
Expand description

Wraps core::alloc::GlobalAlloc to implement the FlexSource trait.

Since this type does not implement FlexSource::realloc_inplace_grow, it is likely to end up with terribly fragmented memory pools.

Tuple Fields

0: T

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The constant default value.

Formats the value using the given formatter. Read more

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

Allocate a memory block of the requested minimum size. Read more

Deallocate a previously allocated memory block. Read more

Check if this allocator implements Self::dealloc. Read more

Get the minimum alignment of allocations made by this allocator. FlexTlsf may be less efficient if this method returns a value less than GRANULARITY. Read more

Attempt to grow the specified allocation without moving it. Returns the final allocation size (which must be greater than or equal to min_new_len) on success. Read more

Check if this allocator implements Self::realloc_inplace_grow. Read more

Returns true if this allocator is implemented by managing one contiguous region, which is grown every time alloc or realloc_inplace_grow is called. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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.