Product Type

DynamicBuffer

A buffer of elements stored in a contiguous region of memory, whose size is determined at instance creation.

Details

Warning: The deinitializer of DynamicBuffer does not deinitialize the elements that may be stored in its payload. You must ensure that they are properly deinitialized before deinit is called.

Members

Type Aliases

typealias BufferHeader = (capacity: Int, payload_header: Header)

The description of payloads in DynamicBuffers.

Functions

static fun payload_offset() -> Int

Returns the number of bytes from a base pointer to the payload in instances of Self.

fun first_element_address() -> PointerToMutable<Element>

Returns the address of the initial element.

fun deinit() { sink }

Deinitializes self.

fun capacity() -> Int

The number of elements that can be stored in self.

fun buffer_header() -> PointerToMutable<BufferHeader>

Returns the address of the self's header.

Subscripts

property header: Header { let, inout }

Accesses the header of self.

Initializers

init()

Creates an empty instance.

init<E>(capacity: Int, initializing_header_with init_header: [E] (Header) let -> Void)

Creates an instance for storing capacity instances of Element and calls init_header to initialize a Header.