Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UnsafeAppendBuffer

An unmanaged, untyped, heterogeneous buffer.
Read time 1 minuteLast updated 12 days ago

Definition

public struct UnsafeAppendBuffer : INativeDisposable, IDisposable

Remarks

The values written to an individual append buffer can be of different types.

Fields

Value

Description

AlignmentThe byte alignment used when allocating the internal buffer.
AllocatorThe allocator used to create the internal buffer.
CapacityThe size in bytes of the internal buffer.
LengthThe size in bytes of the currently-used portion of the internal buffer.
PtrThe internal buffer where the content is stored.

Constructors

Constructor

Description

UnsafeAppendBuffer(System.Int32,System.Int32,Unity.Collections.AllocatorManager.AllocatorHandle)Initializes and returns an instance of UnsafeAppendBuffer.
UnsafeAppendBuffer(System.Void*,System.Int32)Initializes and returns an instance of UnsafeAppendBuffer that aliases an existing buffer.

Properties

Property

Description

IsCreatedWhether this append buffer has been allocated (and not yet deallocated).
IsEmptyWhether the append buffer is empty.

Methods

Method

Description

AddAppends an element to the end of this append buffer.
AddArrayAppends the elements of a buffer to the end of this append buffer.
AsReaderReturns a reader for this append buffer.
DisposeReleases all resources (memory and safety handles).
PopRemoves and copies the last element of this append buffer.
ResetSets the length to 0.
ResizeUninitializedSets the length in bytes.
SetCapacitySets the size in bytes of the internal buffer.

Structs

Struct

Description

UnsafeAppendBuffer.ReaderA reader for UnsafeAppendBuffer.