Expand description
The allocator module.
The module provides custom memory allocator support traits and utilities based on the unstable feature(allocator_api).
Currently implemented as a reexport of parts of the [allocator_api2].
Macros§
- unsize_
box - Allows turning a
Box<T: Sized, A>
into aBox<U: ?Sized, A>
whereT
can be unsizing-coerced into aU
.
Structs§
- Alloc
Error - The
AllocError
error indicates an allocation failure that may be due to resource exhaustion or to something wrong when combining the given input arguments with this allocator. - Box
- A pointer type for heap allocation.
- Global
- The global memory allocator.
Traits§
- Allocator
- An implementation of
Allocator
can allocate, grow, shrink, and deallocate arbitrary blocks of data described viaLayout
. - TryClone
In - Explicitly duplicate an object using the specified Allocator.
Functions§
- allocate
- Moves
value
to the memory backed byalloc
and returns a pointer.