Επεξεργασία

Κοινή χρήση μέσω


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>

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>()

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

Properties

Shared

Gets a shared ArrayPool<T> instance.

Methods

Create()

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

Create(Int32, Int32)

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

Equals(Object)

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

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Rent(Int32)

Retrieves a buffer that is at least the requested length.

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()

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.