C# Класс Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPool2

Used to allocate and distribute re-usable blocks of memory.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispose ( ) : void
Lease ( int minimumSize ) : Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolBlock2

Called to take a block from the pool.

Return ( Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolBlock2 block ) : void

Called to return a block to the pool. Once Return has been called the memory no longer belongs to the caller, and Very Bad Things will happen if the memory is read of modified subsequently. If a caller fails to call Return and the block tracking object is garbage collected, the block tracking object's finalizer will automatically re-create and return a new tracking object into the pool. This will only happen if there is a bug in the server, however it is necessary to avoid leaving "dead zones" in the slab due to lost block tracking objects.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Приватные методы

Метод Описание
AllocateSlab ( ) : void

Internal method called when a block is requested and the pool is empty. It allocates one additional slab, creates all of the block tracking objects, and adds them all to the pool.

Описание методов

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

Lease() публичный Метод

Called to take a block from the pool.
public Lease ( int minimumSize ) : Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolBlock2
minimumSize int The block returned must be at least this size. It may be larger than this minimum size, and if so, /// the caller may write to the block's entire size rather than being limited to the minumumSize requested.
Результат Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolBlock2

Return() публичный Метод

Called to return a block to the pool. Once Return has been called the memory no longer belongs to the caller, and Very Bad Things will happen if the memory is read of modified subsequently. If a caller fails to call Return and the block tracking object is garbage collected, the block tracking object's finalizer will automatically re-create and return a new tracking object into the pool. This will only happen if there is a bug in the server, however it is necessary to avoid leaving "dead zones" in the slab due to lost block tracking objects.
public Return ( Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolBlock2 block ) : void
block Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolBlock2 The block to return. It must have been acquired by calling Lease on the same memory pool instance.
Результат void