The memory layout of a type, describing its size, stride, and alignment.
Swift Standard Library
You can use MemoryLayout as a source of information about a type when allocating or binding memory using unsafe pointers. The following example declares a Point type with x and y coordinates and a Boolean isFilled property.
The size, stride, and alignment of the Point type are accessible as static properties of MemoryLayout<Point>.
Always use a multiple of a type’s stride instead of its size when allocating memory or accounting for the distance between instances in memory. This example allocates untyped, uninitialized memory with space for four instances of Point.
Returns the number of bytes from the start of one instance of T to the start of the next when stored in contiguous memory or in an Array<T>.
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.