Table of Contents

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

pool ArrayPool<T>
length int

ArrayPoolReturner(ArrayPool<T>, ReadOnlySpan<T>)

public ArrayPoolReturner(ArrayPool<T> pool, ReadOnlySpan<T> data)

Parameters

pool ArrayPool<T>
data ReadOnlySpan<T>

Remarks

Copies the data from span into the pooled array.

ArrayPoolReturner(int)

public ArrayPoolReturner(int length)

Parameters

length int

ArrayPoolReturner(ReadOnlySpan<T>)

public ArrayPoolReturner(ReadOnlySpan<T> data)

Parameters

data ReadOnlySpan<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

int

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

self ArrayPoolReturner<T>

Returns

Memory<T>

implicit operator Span<T>(in ArrayPoolReturner<T>)

public static implicit operator Span<T>(in ArrayPoolReturner<T> self)

Parameters

self ArrayPoolReturner<T>

Returns

Span<T>