Contents

init(buffer:initializedCount:)

Unsafely create an OutputRawSpan over partly-initialized memory.

Declaration

init(buffer: borrowing Slice<UnsafeMutableRawBufferPointer>, initializedCount: Int)

Parameters

  • buffer:

    A Slice<UnsafeMutableRawBufferPointer> to be initialized

  • initializedCount:

    The number of initialized bytes at the beginning of buffer.

Discussion

The memory in buffer must remain valid throughout the lifetime of the newly-created OutputRawSpan. Its prefix must contain initializedCount initialized bytes, followed by uninitialized memory.