-
A unique
Allocationidentifier.Declaration
Swift
public typealias ID = Int -
The bytes preceded by zero or more bytes of initial padding for alignment purposes.
Declaration
Swift
var storage: Storage -
The number of usable bytes of
self.Declaration
Swift
public let size: Int -
A region of some allocation that contains a complete instance of some type, ready to be a part of a new composition.
See
See morecompose(:at:).Declaration
Swift
public struct ComposedRegion : Regular -
The composed regions of an
Allocation.Declaration
Swift
fileprivate typealias ComposedRegions = [ComposedRegion] -
The composed regions, in ascending order.
Declaration
Swift
private var composedRegions: Memory.Allocation.ComposedRegions -
The address of the
oth byte. -
Throws iff the given
partof some type atbaseOffsetis not represented as thenth composed region.Declaration
Swift
public func requireComposed( part: TypeLayout.Part.Parentage, baseOffset: Offset, region n: Int ) throws -
Throws iff there is not enough allocated space for a
tata, or if it would not be properly aligned.Declaration
Swift
fileprivate func checkAlignmentAndAllocationBounds(at a: Offset, for t: TypeLayout) throws -
Replaces the initialization records starting at
afor the parts of atinstance with the initialization record for atinstance.Declaration
Swift
public mutating func compose(_ t: TypeLayout, at a: Offset) throws -
Returns the result of calling
bodyon the storage for aTinstance ata.Precondition
the storage exists and is properly aligned.Declaration
Swift
mutating func withUnsafeMutablePointer<T, R>( to _: T.Type, at a: Offset, _ body: (UnsafeMutablePointer<T>)->R ) -> R -
Returns the result of calling
bodyon the storage for aTinstance ata.Precondition
the storage exists and is properly aligned.Declaration
Swift
func withUnsafePointer<T, R>( to _: T.Type, at a: Offset, _ body: (UnsafePointer<T>)->R ) -> R -
Returns the unsigned interpretation of the builtin integer value at
a;Declaration
Swift
private func unsignedIntValue(at a: Offset, ofType t: BuiltinType) -> UInt -
Initializes the raw storage of builtin integer type
tatatox.Note
performs no alignment, size, initialization, or type checking. Use with care!Declaration
Swift
internal mutating func initialize(_ t: BuiltinType, at a: Offset, to x: UInt) -
Returns
trueiffois aligned to annbyte boundary.Declaration
Swift
public func offset(_ o: Offset, hasAlignment n: Int) -> Bool -
Returns the region index of the top-level composed instance of
tata, if any, ornilotherwise.Declaration
Swift
fileprivate func decomposable(_ t: TypeLayout, at a: Offset) -> ComposedRegions.Index? -
Replaces the initialization record for a
tinstance atawith the initialization records for any parts of that instance.Declaration
Swift
fileprivate mutating func decompose(_ t: TypeLayout, inRegion i: ComposedRegions.Index)
View on GitHub