ArrayPool<T> ArrayPool<T> ArrayPool<T> ArrayPool<T> Class

Definition

Provides a resource pool that enables reusing instances of type T[].

generic <typename T>
public ref class ArrayPool abstract
public abstract class ArrayPool<T>
type ArrayPool<'T> = class
Public MustInherit Class ArrayPool(Of T)

Type Parameters

T

The type of the objects that are in the resource pool.

Inheritance
ArrayPool<T>ArrayPool<T>ArrayPool<T>ArrayPool<T>

Remarks

Using the ArrayPool<T> class to rent and return buffers (using the Rent and Return methods) can improve performance in situations where arrays are created and destroyed frequently, resulting in significant memory pressure on the garbage collector.

Constructors

ArrayPool<T>() ArrayPool<T>() ArrayPool<T>() ArrayPool<T>()

Initializes a new instance of the ArrayPool<T> class.

Properties

Shared Shared Shared Shared

Gets a shared ArrayPool<T> instance.

Methods

Create() Create() Create() Create()

Creates a new instance of the ArrayPool<T> class.

Create(Int32, Int32) Create(Int32, Int32) Create(Int32, Int32) Create(Int32, Int32)

Creates a new instance of the ArrayPool<T> class using the specified configuration.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Rent(Int32) Rent(Int32) Rent(Int32) Rent(Int32)

Retrieves a buffer that is at least the requested length.

Return(T[], Boolean) Return(T[], Boolean) Return(T[], Boolean) Return(T[], Boolean)

Returns an array to the pool that was previously obtained using the Rent(Int32) method on the same ArrayPool<T> instance.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

Thread Safety

This class is thread-safe. All members may be used by multiple threads concurrently.