ArrayPool<T> Clase
Definición
Proporciona un grupo de recursos que permite volver a usar instancias de tipo 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)
Parámetros de tipo
- T
El tipo de los objetos que se encuentran en el grupo de recursos.The type of the objects that are in the resource pool.
- Herencia
-
ArrayPool<T>
Comentarios
El uso de la ArrayPool<T> clase para alquilar y devolver búferes (mediante los Rent Return métodos y) puede mejorar el rendimiento en situaciones en las que las matrices se crean y se destruyen con frecuencia, lo que produce una presión de memoria significativa en el recolector de elementos no utilizados.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.
Constructores
| ArrayPool<T>() |
Inicializa una nueva instancia de la clase ArrayPool<T>.Initializes a new instance of the ArrayPool<T> class. |
Propiedades
| Shared |
Obtiene una instancia compartida de ArrayPool<T>.Gets a shared ArrayPool<T> instance. |
Métodos
| Create() |
Crea una nueva instancia de la clase ArrayPool<T>.Creates a new instance of the ArrayPool<T> class. |
| Create(Int32, Int32) |
Crea una nueva instancia de la clase ArrayPool<T> con la condición especificada.Creates a new instance of the ArrayPool<T> class using the specified configuration. |
| Equals(Object) |
Determina si el objeto especificado es igual que el objeto actual.Determines whether the specified object is equal to the current object. (Heredado de Object) |
| GetHashCode() |
Sirve como la función hash predeterminada.Serves as the default hash function. (Heredado de Object) |
| GetType() |
Obtiene el Type de la instancia actual.Gets the Type of the current instance. (Heredado de Object) |
| MemberwiseClone() |
Crea una copia superficial del Object actual.Creates a shallow copy of the current Object. (Heredado de Object) |
| Rent(Int32) |
Recupera un búfer que tiene al menos la longitud solicitada.Retrieves a buffer that is at least the requested length. |
| Return(T[], Boolean) |
Devuelve una matriz al grupo que se ha obtenido anteriormente al usar el método Rent(Int32) en la misma instancia de ArrayPool<T>.Returns an array to the pool that was previously obtained using the Rent(Int32) method on the same ArrayPool<T> instance. |
| ToString() |
Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object. (Heredado de Object) |
Se aplica a
Seguridad para subprocesos
Esta clase es segura para subprocesos.This class is thread-safe. Varios subprocesos pueden usar todos los miembros simultáneamente.All members may be used by multiple threads concurrently.