Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UnsafeBitArray

Initializes and returns an instance of UnsafeBitArray which aliases an existing buffer.
Read time 1 minuteLast updated 13 days ago

Definition

UnsafeBitArray(void*, int, AllocatorHandle)

Initializes and returns an instance of UnsafeBitArray which aliases an existing buffer.
public UnsafeBitArray(void* ptr, int sizeInBytes, AllocatorManager.AllocatorHandle allocator = default)

Parameters

An existing buffer.

sizeInBytes

The number of bytes. The length will be
sizeInBytes * 8
.

The allocator that was used to allocate the bytes. Needed to dispose this array.

UnsafeBitArray(int, AllocatorHandle, NativeArrayOptions)

Initializes and returns an instance of UnsafeBitArray.
public UnsafeBitArray(int numBits, AllocatorManager.AllocatorHandle allocator, NativeArrayOptions options = NativeArrayOptions.ClearMemory)

Parameters

numBits

Number of bits.

The allocator to use.

Whether newly allocated bytes should be zeroed out.