Class NativeBitArrayUnsafeUtility
Unsafe helper methods for NativeBitArray.
Namespace: Unity.Collections.LowLevel.Unsafe
Assembly: Unity.Collections.dll
Syntax
public static class NativeBitArrayUnsafeUtility
Methods
ConvertExistingDataToNativeBitArray(void*, int, AllocatorHandle)
Returns a bit array with content aliasing a buffer.
Declaration
public static NativeBitArray ConvertExistingDataToNativeBitArray(void* ptr, int sizeInBytes, AllocatorManager.AllocatorHandle allocator)
Parameters
Type | Name | Description |
---|---|---|
void* | ptr | A buffer. |
int | sizeInBytes | Size of the buffer in bytes. Must be a multiple of 8. |
AllocatorManager.AllocatorHandle | allocator | The allocator that was used to create the buffer. |
Returns
Type | Description |
---|---|
NativeBitArray | A bit array with content aliasing a buffer. |
GetAtomicSafetyHandle(in NativeBitArray)
Returns an array's atomic safety handle.
Declaration
public static AtomicSafetyHandle GetAtomicSafetyHandle(in NativeBitArray container)
Parameters
Type | Name | Description |
---|---|---|
NativeBitArray | container | Array from which to get an AtomicSafetyHandle. |
Returns
Type | Description |
---|---|
AtomicSafetyHandle | This array's atomic safety handle. |
SetAtomicSafetyHandle(ref NativeBitArray, AtomicSafetyHandle)
Sets an array's atomic safety handle.
Declaration
public static void SetAtomicSafetyHandle(ref NativeBitArray container, AtomicSafetyHandle safety)
Parameters
Type | Name | Description |
---|---|---|
NativeBitArray | container | Array which the AtomicSafetyHandle is for. |
AtomicSafetyHandle | safety | Atomic safety handle for this array. |