Function swift_runtime_sys::root::swift::swift_allocBox

source ยท
pub unsafe extern "C" fn swift_allocBox(
    type_: *const Metadata,
) -> BoxPair
Expand description

Allocates a heap object that can contain a value of the given type. Returns a Box structure containing a HeapObject* pointer to the allocated object, and a pointer to the value inside the heap object. The value pointer points to an uninitialized buffer of size and alignment appropriate to store a value of the given type. The heap object has an initial retain count of 1, and its metadata is set such that destroying the heap object destroys the contained value.