System::Buffers::ArrayPool::Return method

ArrayPool::Return method

Returns a previously rented buffer back to the pool.

void System::Buffers::ArrayPool<T>::Return(const ArrayPtr<T> &array, bool clearArray=false)
ParameterTypeDescription
arrayconst ArrayPtr<T>&The buffer obtained previously from Rent().
clearArrayboolIf true, the buffer contents are cleared before pooling.

Remarks

Arrays whose length does not match this pool’s configuration (e.g. those that were allocated by Rent() beyond m_maxArrayLength, or come from another pool) are not pooled and are simply released by the reference counting / GC mechanism.

See Also