init(buffer:initializedCount:)
Unsafely create an OutputSpan over partly-initialized memory.
Declaration
init(buffer: borrowing Slice<UnsafeMutableBufferPointer<Element>>, initializedCount: Int)Parameters
- buffer:
An
UnsafeMutableBufferPointerto be initialized - initializedCount:
The number of initialized elements at the beginning of
buffer.
Discussion
The memory in buffer must remain valid throughout the lifetime of the newly-created OutputSpan. Its prefix must contain initializedCount initialized instances, followed by uninitialized memory. The default value of initializedCount is 0, representing the common case of a completely uninitialized buffer.