Struct UnsafeList<T>
An unmanaged, resizable list.
Namespace: Unity.Collections.LowLevel .Unsafe
Assembly: solution.dll
Syntax
public struct UnsafeList<T> : INativeDisposable, INativeList<T>, IIndexable<T> where T : unmanaged
Type Parameters
Name | Description |
---|---|
T | The type of the elements. |
Constructors
Name | Description |
---|---|
Unsafe |
Initializes and returns an instance of UnsafeList. |
Unsafe |
Initializes and returns an instance of UnsafeList. |
Fields
Name | Description |
---|---|
Allocator | The allocator used to create the internal buffer. |
Ptr | The internal buffer of this list. |
m_capacity | The number of elements that can fit in the internal buffer. |
m_length | The number of elements. |
Properties
Name | Description |
---|---|
Capacity | The number of elements that can fit in the internal buffer. |
Is |
Whether this list has been allocated (and not yet deallocated). |
Is |
Whether the list is empty. |
this[int] | The element at an index. |
Length | The number of elements. |
Methods
Name | Description |
---|---|
Add(in T) | Adds an element to the end of the list. |
Add |
Adds an element to the end of this list. |
Add |
Copies the elements of a buffer to the end of this list. |
Add |
Copies the elements of another list to the end of the list. |
Add |
Copies elements from a buffer to the end of this list. |
Add |
Copies the elements of another list to the end of this list. |
Add |
Appends value count times to the end of this list. |
As |
Obsolete. Use As |
As |
Returns a parallel writer of this list. |
As |
Returns a read only of this list. |
Clear() | Sets the length to 0. |
Copy |
Copies all elements of specified container to this container. |
Copy |
Copies all elements of specified container to this container. |
Create(int, Allocator |
Returns a new list. |
Destroy(Unsafe |
Destroys the list. |
Dispose() | Releases all resources (memory). |
Dispose(Job |
Creates and schedules a job that frees the memory of this list. |
Element |
Returns a reference to the element at a given index. |
Get |
Returns an enumerator over the elements of the list. |
Insert |
Shifts elements toward the end of this list, increasing its length. |
Insert |
Shifts elements toward the end of this list, increasing its length. |
Remove |
Removes the element at an index, shifting everything above it down by one. Decrements the length by 1. |
Remove |
Copies the last element of this list to the specified index. Decrements the length by 1. |
Remove |
Removes N elements in a range, shifting everything above the range down by N. Decrements the length by N. |
Remove |
Copies the last N elements of this list to a range in this list. Decrements the length by N. |
Resize(int, Native |
Sets the length, expanding the capacity if necessary. |
Set |
Sets the capacity. |
Trim |
Sets the capacity to match the length. |