System::Buffers::ArrayPool class

ArrayPool class

Provides a thread-safe pool for reusing managed array instances (ArrayPtr).

template<typename T>class ArrayPool : public System::Object
ParameterDescription
TThe type of elements held by pooled arrays.

Methods

MethodDescription
explicit ArrayPool(int32_t, int32_t)Creates an ArrayPool instance.
static Create(int32_t, int32_t)Creates a new pool instance with custom configuration options.
static get_Shared()Retrieves the process-wide shared pool instance. The instance is created lazily on first access and configured with the default options.
Rent(int32_t)Obtains a buffer that is at least minimumLength long.
Return(const ArrayPtr<T>&, bool)Returns a previously rented buffer back to the pool.

See Also