/// An implementation of `Allocator` can allocate, grow, shrink, and deallocate arbitrary blocks of
/// In contrast to [`GlobalAlloc`][], `Allocator` allows zero-sized allocations. If an underlying
/// Some of the methods require that a `layout` *fit* a memory block or vice versa. This means that the
/// Copying, cloning, or moving the allocator must not invalidate memory blocks returned from it.
/// On success, returns a [`NonNull<[u8]>`][NonNull] meeting the size and alignment guarantees of `layout`.
/// The returned block of memory remains valid as long as it is [*currently allocated*] and the shorter of:
/// Implementations are encouraged to return `Err` on memory exhaustion rather than panicking or
/// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar.
/// Implementations are encouraged to return `Err` on memory exhaustion rather than panicking or
/// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar.
/// Returns a new [`NonNull<[u8]>`][NonNull] containing a pointer and the actual size of the allocated
/// transferred to this allocator. Any access to the old `ptr` is Undefined Behavior, even if the
/// If this method returns `Err`, then ownership of the memory block has not been transferred to
/// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.).
/// Implementations are encouraged to return `Err` on memory exhaustion rather than panicking or
/// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar.
/// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.).
/// Implementations are encouraged to return `Err` on memory exhaustion rather than panicking or
/// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar.
/// Returns a new [`NonNull<[u8]>`][NonNull] containing a pointer and the actual size of the allocated
/// transferred to this allocator. Any access to the old `ptr` is Undefined Behavior, even if the
/// If this method returns `Err`, then ownership of the memory block has not been transferred to
/// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.).
/// Implementations are encouraged to return `Err` on memory exhaustion rather than panicking or
/// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar.