kvarn_async::prelude::compact_str::core::alloc

Struct Layout

1.28.0 · source
pub struct Layout { /* private fields */ }
Expand description

Layout of a block of memory.

An instance of Layout describes a particular layout of memory. You build a Layout up as an input to give to an allocator.

All layouts have an associated size and a power-of-two alignment. The size, when rounded up to the nearest multiple of align, does not overflow isize (i.e., the rounded value will always be less than or equal to isize::MAX).

(Note that layouts are not required to have non-zero size, even though GlobalAlloc requires that all memory requests be non-zero in size. A caller must either ensure that conditions like this are met, use specific allocators with looser requirements, or use the more lenient Allocator interface.)

Implementations§