Scripting API

UnsafeList<T>

struct in Unity.Collections.LowLevel.Unsafe · Unity.Collections

Not in Unity's public API, or in an assembly the coverage doesn't count.
In Tassix

A growable array in native memory without safety checks: capacity grows to the next power of two (at least a cache line of elements).

Constructors 1

UnsafeList(T* ptr, int length)
UnsafeList(int initialCapacity, AllocatorManager.AllocatorHandle allocator, NativeArrayOptions options = NativeArrayOptions.UninitializedMemory)

Fields 4

T* Ptr
int m_capacity
int m_length

Properties 5

int Capacity { get; set; }
readonly bool IsCreated { get; }
readonly bool IsEmpty { get; }
int Length { get; set; }
T this[int index] { get; set; }

Methods 22

void Add(in T value)
void AddNoResize(T value)
void AddRange(void* ptr, int count)
void AddRange(UnsafeList<T> list)
void AddRangeNoResize(void* ptr, int count)
void AddRangeNoResize(UnsafeList<T> list)
void AddReplicate(in T value, int count)
ParallelWriter AsParallelWriter()
void Clear()
void CopyFrom(in NativeArray<T> other)
void CopyFrom(in UnsafeList<T> other)
static UnsafeList<T>* Create(int initialCapacity, AllocatorManager.AllocatorHandle allocator, NativeArrayOptions options = NativeArrayOptions.UninitializedMemory)
static void Destroy(UnsafeList<T>* listData)
void Dispose()
JobHandle Dispose(JobHandle inputDeps)
ref T ElementAt(int index)
Enumerator GetEnumerator()
void InsertRange(int index, int count)
void InsertRangeWithBeginEnd(int begin, int end)
void RemoveAt(int index)
void RemoveAtSwapBack(int index)
void RemoveRange(int index, int count)
void RemoveRangeSwapBack(int index, int count)
void Resize(int length, NativeArrayOptions options = NativeArrayOptions.UninitializedMemory)
void SetCapacity(int capacity)

Grows (or shrinks to at least Length) to the next power of two, at least a cache line of elements.

void TrimExcess()