C# 클래스 Microsoft.AspNet.Server.Kestrel.Infrastructure.MemoryPool2

Used to allocate and distribute re-usable blocks of memory.
상속: IDisposable
파일 보기 프로젝트 열기: Starcounter/KestrelHttpServer 1 사용 예제들

공개 메소드들

메소드 설명
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