ArrayPool<T> Třída
Definice
Poskytuje fond zdrojů, který umožňuje znovu použít instance typu T [].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)
Parametry typu
- T
Typ objektů, které jsou ve fondu zdrojů.The type of the objects that are in the resource pool.
- Dědičnost
-
ArrayPool<T>
Poznámky
Použití ArrayPool<T> třídy k pronajmutí a návratové vyrovnávací paměti (pomocí Rent metod a Return ) může zlepšit výkon v situacích, kdy jsou pole vytvářena a zničena často, což vede k významnému zatížení paměti v systému uvolňování paměti.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.
Konstruktory
| ArrayPool<T>() |
Inicializuje novou instanci ArrayPool<T> třídy.Initializes a new instance of the ArrayPool<T> class. |
Vlastnosti
| Shared |
Načte sdílenou ArrayPool<T> instanci.Gets a shared ArrayPool<T> instance. |
Metody
| Create() |
Vytvoří novou instanci třídy ArrayPool<T>.Creates a new instance of the ArrayPool<T> class. |
| Create(Int32, Int32) |
Vytvoří novou instanci ArrayPool<T> třídy pomocí zadané konfigurace.Creates a new instance of the ArrayPool<T> class using the specified configuration. |
| Equals(Object) |
Určí, zda se zadaný objekt rovná aktuálnímu objektu.Determines whether the specified object is equal to the current object. (Zděděno od Object) |
| GetHashCode() |
Slouží jako výchozí funkce hash.Serves as the default hash function. (Zděděno od Object) |
| GetType() |
Získá Type aktuální instanci.Gets the Type of the current instance. (Zděděno od Object) |
| MemberwiseClone() |
Vytvoří kopii aktuálního seznamu Object .Creates a shallow copy of the current Object. (Zděděno od Object) |
| Rent(Int32) |
Načte vyrovnávací paměť, která má alespoň požadovanou délku.Retrieves a buffer that is at least the requested length. |
| Return(T[], Boolean) |
Vrátí pole do fondu, který byl dříve získán pomocí Rent(Int32) metody ve stejné ArrayPool<T> instanci.Returns an array to the pool that was previously obtained using the Rent(Int32) method on the same ArrayPool<T> instance. |
| ToString() |
Vrátí řetězec, který představuje aktuální objekt.Returns a string that represents the current object. (Zděděno od Object) |
Platí pro
Bezpečný přístup z více vláken
Tato třída je bezpečná pro přístup z více vláken.This class is thread-safe. Všechny členy mohou být používány současně více vlákny.All members may be used by multiple threads concurrently.