Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

UnsafePtrList<T0>

struct in Unity.Collections.LowLevel.Unsafe


Implements interfaces:INativeDisposable

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

An unmanaged, resizable list of pointers.

Properties

Property Description
Allocator The allocator used to create the internal buffer.
Capacity The number of elements that can fit in the internal buffer.
IsCreated Whether this list has been allocated (and not yet deallocated).
IsEmpty Whether the list is empty.
Length The number of elements.
m_capacity The number of elements that can fit in the internal buffer.
m_length The number of elements.
Ptr The internal buffer of this list.
this[int] The element at an index.

Constructors

Constructor Description
UnsafePtrList_1 Initializes and returns an instance of UnsafePtrList.

Public Methods

Method Description
Add Adds a pointer to the end of the list.
AddNoResize Adds a pointer to the end of this list.
AddRange Adds elements from a buffer to this list.
AddRangeNoResize Copies pointers from a buffer to the end of this list.
AsParallelReader Obsolete. Use UnsafePtrList<T0>.AsReadOnly instead.
AsParallelWriter Returns a parallel writer of this list.
AsReadOnly Returns a read only of this list.
Clear Sets the length to 0.
Contains Returns true if the list contains at least one occurrence of a specific pointer.
Dispose Releases all resources (memory).
ElementAt Returns a reference to the element at a given index.
IndexOf Returns the index of the first occurrence of a specific pointer in the list.
InsertRangeWithBeginEnd Shifts pointers toward the end of this list, increasing its length.
RemoveAt Removes the pointer at an index, shifting everything above it down by one. Decrements the length by 1.
RemoveAtSwapBack Copies the last pointer of this list to the specified index. Decrements the length by 1.
RemoveRange Removes "N" pointers in a range, shifting everything above the range down by "N". Decrements the length by "N".
RemoveRangeSwapBack Copies the last "N" pointer of this list to a range in this list. Decrements the length by "N".
Resize Sets the length, expanding the capacity if necessary.
SetCapacity Sets the capacity.
TrimExcess Sets the capacity to match the length.

Static Methods

Method Description
Create Returns a new list of pointers.
Destroy Destroys the list.