ArrayPool<T>.Create Method

Definition

Overloads

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.

Create()

Source:
ArrayPool.cs
Source:
ArrayPool.cs
Source:
ArrayPool.cs

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

C#
public static System.Buffers.ArrayPool<T> Create();

Returns

A new instance of the ArrayPool<T> class.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1

Create(Int32, Int32)

Source:
ArrayPool.cs
Source:
ArrayPool.cs
Source:
ArrayPool.cs

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

C#
public static System.Buffers.ArrayPool<T> Create(int maxArrayLength, int maxArraysPerBucket);

Parameters

maxArrayLength
Int32

The maximum length of an array instance that may be stored in the pool.

maxArraysPerBucket
Int32

The maximum number of array instances that may be stored in each bucket in the pool. The pool groups arrays of similar lengths into buckets for faster access.

Returns

A new instance of the ArrayPool<T> class with the specified configuration.

Remarks

The instance of the ArrayPool<T> class created by this method will group arrays into buckets, with no more than maxArraysPerBucket in each bucket, and with those arrays not exceeding maxArrayLength in length.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1