Skip to content

swift_allocObject(for:size:alignment:)

Azoy edited this page May 6, 2021 · 2 revisions

swift_allocObject(for:size:alignment:)

Allocates a new reference counted class instance.

public func swift_allocObject(
  for type: ClassMetadata,
  size: Int,
  alignment: Int
) -> UnsafeRawPointer 

Parameters

  • type: The class metadata to allocate an instance for.

Returns

A pointer to the heap object. This is intentionally left raw because there is almost always more initialization that needs to happen after allocation.

Types
Protocols
Global Variables
Global Functions
Clone this wiki locally