Module allocator

Source
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 a Box<U: ?Sized, A> where T can be unsizing-coerced into a U.

Structs§

AllocError
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 via Layout.
TryCloneIn
Explicitly duplicate an object using the specified Allocator.

Functions§

allocate
Moves value to the memory backed by alloc and returns a pointer.