-
Notifications
You must be signed in to change notification settings - Fork 26
ValueWitnessTable
The value witness table is a table of function pointers that describe how to properly copy, destroy, etc. memory for a given type. It also contains type layout information about the type including size, stride, and alignment.
public struct ValueWitnessTable: LayoutWrapper
ABI Stability: Stable since the following
| macOS | iOS/tvOS | watchOS | Linux | Windows |
|-------|----------|---------|-------|---------|
| 10.14 | 12.2 | 5.2 | NA | NA |
The size in bytes that this type represents in memory.
public var size: Int
The required size in bytes needed to represent an element if this type were in an array.
public var stride: Int
The flags describing this value witness table.
public var flags: Flags
The number of extra inhabitants in this type.
public var extraInhabitantCount: Int
Given a buffer an instance of the type in the source buffer, initialize the destination buffer with a copy of the source.
public func initializeBufferWithCopyOfBuffer(
_ dest: UnsafeMutableRawPointer,
_ source: UnsafeMutableRawPointer
)
- dest: The desintation buffer.
- source: The source buffer with the instance.
Given an instance of this type, destroy it. The resulting pointer is now an invalid instance.
public func destroy(_ value: UnsafeMutableRawPointer)
- value: An instance of this type.
Given an invalid instance of this type and a valid instance of this type, copy the source instance into the destination.
public func initializeWithCopy(
_ dest: UnsafeMutableRawPointer,
_ source: UnsafeMutableRawPointer
)
- dest: An invalid instance of type.
- source: An instance of type.
Given a valid instance of this type and another valid instance of this type, copy the contents from the source into the destination.
public func assignWithCopy(
_ dest: UnsafeMutableRawPointer,
_ source: UnsafeMutableRawPointer
)
- dest: An instance of type whose contents are going to be overwritten.
- source: An instance of type.
Given an invalid instance of this type and a valid instance of this type, initialize the destination by destroying the source instance.
public func initializeWithTake(
_ dest: UnsafeMutableRawPointer,
_ source: UnsafeMutableRawPointer
)
- dest: An invalid instance of type.
- source: An instance of type.
Given a valid instance of this type and another valid instance of this type, copy the contents from the source instance into the destination while also destroying the source instance.
public func assignWithTake(
_ dest: UnsafeMutableRawPointer,
_ source: UnsafeMutableRawPointer
)
- dest: An instance of type.
- source: An instance of type.
Given an instance of an enum case who has a single payload of this type, get the case tag of the enum.
public func getEnumTagSinglePayload(
_ instance: UnsafeRawPointer,
_ numEmptyCases: UInt32
) -> UInt32
- instance: The enum case instance.
- numEmptyCases: The number of cases without payloads in this enum.
The enum case tag for the payload containing this type.
Given some uninitialzed data of an enum case who has a single payload of this type, store the tag in the data.
public func storeEnumTagSinglePayload(
_ instance: UnsafeMutableRawPointer,
_ tag: UInt32,
_ numEmptyCases: UInt32
)
- instance: The uninitialized instance of the enum case.
- tag: The enum case tag number for the payload with this type.
- numEmptyCases: The number of cases without payloads in this enum.
Generated at 2021-05-06T17:56:33+0000 using swift-doc 1.0.0-beta.6.
Types
- AnonymousDescriptor
- AnonymousDescriptor.Flags
- AnyExistentialContainer
- BoxPair
- ClassDescriptor
- ClassMetadata
- ClassMetadata.Flags
- ConformanceDescriptor
- ConformanceDescriptor.Flags
- ContextDescriptorFlags
- ContextDescriptorKind
- DualExistentialContainer
- EnumDescriptor
- EnumMetadata
- EnumValueWitnessTable
- ExistentialContainer
- ExistentialMetadata
- ExistentialMetadata.Flags
- ExistentialMetatypeMetadata
- ExtensionDescriptor
- FieldDescriptor
- FieldDescriptor.Kind
- FieldRecord
- FieldRecord.Flags
- ForeignClassMetadata
- ForeignMetadataInitialization
- FunctionConvention
- FunctionMetadata
- FunctionMetadata.Flags
- FunctionMetadata.ParamFlags
- GenericContext
- GenericMetadataPattern
- GenericMetadataPattern.Flags
- GenericParameterDescriptor
- GenericParameterKind
- GenericRequirementDescriptor
- GenericRequirementDescriptor.Flags
- GenericRequirementKind
- GenericRequirementLayoutKind
- HeapGenericLocalVariableMetadata
- HeapLocalVariableMetadata
- HeapObject
- KnownMetadata
- KnownMetadata.Builtin
- MetadataAccessFunction
- MetadataBounds
- MetadataInitializationKind
- MetadataKind
- MetadataRequest
- MetadataResponse
- MetadataState
- MetatypeMetadata
- MethodDescriptor
- MethodDescriptor.Flags
- MethodDescriptor.Kind
- MethodOverrideDescriptor
- ModuleDescriptor
- ObjCClassWrapperMetadata
- OpaqueDescriptor
- OpaqueMetadata
- OverrideTableHeader
- ProtocolDescriptor
- ProtocolDescriptor.Flags
- ProtocolRequirement
- ProtocolRequirement.Flags
- ProtocolRequirement.Kind
- ReferenceStorageKind
- SingletonMetadataInitialization
- SpecialProtocol
- StructDescriptor
- StructMetadata
- TupleMetadata
- TupleMetadata.Element
- TypeContextDescriptorFlags
- TypeGenericContext
- TypeReferenceKind
- VTableDescriptorHeader
- ValueOwnership
- ValueWitnessTable
- ValueWitnessTable.Flags
- WitnessTable