Method | Description | |
---|---|---|
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.
|
Method | Description | |
---|---|---|
Dispose ( bool disposing ) : void |
Method | Description | |
---|---|---|
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.
|
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. |
return | Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPoolBlock2 |
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. |
return | void |