Skip to content

Metadata

Azoy edited this page May 6, 2021 · 2 revisions

Metadata

Metadata refers to the Swift metadata records in a given binary. All metadata records include a value witness table, which describe how to properly copy, destroy, etc. the memory of a type, along with a given "kind".

public protocol Metadata 

Default Implementations

type

The type that this metadata represents.

public var type: Any.Type 

vwt

The value witness table for this type metadata.

public var vwt: ValueWitnessTable 

enumVwt

The enum value witness table for this enum metadata.

public var enumVwt: EnumValueWitnessTable 

kind

The kind of metadata this is.

public var kind: MetadataKind 

allocateBoxForExistential(in:)

Given a pointer to some existential container, allocate a box on the heap for the container to put the type's value in.

public func allocateBoxForExistential(
    in container: UnsafeMutablePointer<AnyExistentialContainer>
  ) -> UnsafeRawPointer 

Parameters

  • container: Pointer to some existential container.

Returns

A pointer to the newly allocated buffer. If the value is stored inline, then this is a pointer to the container's data field.

Requirements

ptr

Backing metadata pointer.

var ptr: UnsafeRawPointer 
Types
Protocols
Global Variables
Global Functions
Clone this wiki locally