Compartilhar via


ReusableArray<T> Class

Definition

Stores a reusable array. The size of the array returned can either be exactly a requested size or a buffer of at least a requested size depending on the value of the requiresExactSize parameter.

generic <typename T>
public ref class ReusableArray : Microsoft::VisualStudio::Utilities::ReusableResourceStore<cli::array <T> ^, int>
template <typename T>
[Windows::Foundation::Metadata::WebHostHidden]
class ReusableArray : Microsoft::VisualStudio::Utilities::ReusableResourceStore<std::Array <T>, int>
public class ReusableArray<T> : Microsoft.VisualStudio.Utilities.ReusableResourceStore<T[],int>
type ReusableArray<'T> = class
    inherit ReusableResourceStore<'T[], int>
Public Class ReusableArray(Of T)
Inherits ReusableResourceStore(Of T(), Integer)

Type Parameters

T

The type of array to construct.

Inheritance

Constructors

ReusableArray<T>(Boolean, Int32)

Creates a new reusable array.

Methods

Acquire(TConstructorParameter)

Acquires a cached instance of the resource, or allocates a new instance if none are currently available.

(Inherited from ReusableResourceStore<TResource,TConstructorParameter>)
AcquireCore()

Gets access to the resource stored by this object, and removes the resource so that subsequent callers cannot be handed the same resource at the same time.

(Inherited from ReusableResourceStoreBase<TResource>)
Allocate(Int32)

Allocates the specified amount of space.

Allocate(TConstructorParameter)

Allocates a new instance of the resource when one is not available in the cache.

(Inherited from ReusableResourceStore<TResource,TConstructorParameter>)
CanReuse(T[], Int32)

Determines whether the array can be reused.

CanReuse(TResource, TConstructorParameter)

Validates that an already-cached resource value is safe to reuse when Acquire is called.

(Inherited from ReusableResourceStore<TResource,TConstructorParameter>)
Cleanup(T[])

Determines whether the length of the array is less than or equal to the maximum cache size.

Cleanup(TResource)

Immediately before releasing an object, performs cleanup on that object. This might be necessary to clean up state stored in the object to prevent leaking memory.

(Inherited from ReusableResourceStoreBase<TResource>)

Applies to