UnsafeBitArray
Initializes and returns an instance of UnsafeBitArray which aliases an existing buffer.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Constructor
- Namespace: Unity.Collections.LowLevel.Unsafe
- Assembly: UnityEngine.ManagedKernelModule
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.
The number of bytes. The length will be .
sizeInBytes * 8The 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
Number of bits.
The allocator to use.
Whether newly allocated bytes should be zeroed out.