Struct ArrayPoolReturner<T>
- Namespace
- Vintagestory.Datastructures
- Assembly
- VintagestoryAPI.dll
public ref struct ArrayPoolReturner<T> : IDisposable
Type Parameters
T
- Implements
- Inherited Members
Constructors
ArrayPoolReturner(ArrayPool<T>, int)
public ArrayPoolReturner(ArrayPool<T> pool, int length)
Parameters
ArrayPoolReturner(ArrayPool<T>, ReadOnlySpan<T>)
public ArrayPoolReturner(ArrayPool<T> pool, ReadOnlySpan<T> data)
Parameters
poolArrayPool<T>dataReadOnlySpan<T>
Remarks
Copies the data from span into the pooled array.
ArrayPoolReturner(int)
public ArrayPoolReturner(int length)
Parameters
lengthint
ArrayPoolReturner(ReadOnlySpan<T>)
public ArrayPoolReturner(ReadOnlySpan<T> data)
Parameters
dataReadOnlySpan<T>
Remarks
Copies the data from span into the pooled array.
Properties
BorrowedArray
public readonly T[] BorrowedArray { get; }
Property Value
- T[]
RequestedLength
public readonly int RequestedLength { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Operators
implicit operator Memory<T>(in ArrayPoolReturner<T>)
public static implicit operator Memory<T>(in ArrayPoolReturner<T> self)
Parameters
selfArrayPoolReturner<T>
Returns
- Memory<T>
implicit operator Span<T>(in ArrayPoolReturner<T>)
public static implicit operator Span<T>(in ArrayPoolReturner<T> self)
Parameters
selfArrayPoolReturner<T>
Returns
- Span<T>