C# 클래스 SocketServers.SmartBufferPool

Lock-free buffer pool implementation, it is more simple solution than classic memory manager algorithms (e.g. buddy memory manager). But it should use less extra calculation for allocation and freeing buffers. It like "smart" buffer pool, it slices desired sizes, and do not free slices but put it in pool for further using. So big buffer should be sliced for concrete application.
파일 보기 프로젝트 열기: vf1/serversockets 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
ExtraMemoryUsage long
InitialMemoryUsage long
MaxBuffersCount long
MaxMemoryUsage long

공개 메소드들

메소드 설명
Allocate ( int size ) : ArraySegment
Free ( ArraySegment segment ) : void
SmartBufferPool ( int maxMemoryUsageMb, int initialSizeMb, int extraBufferSizeMb ) : System

비공개 메소드들

메소드 설명
GetAllocated ( int size, int &index, int &offset ) : bool
GetBitOffset ( int size ) : int
NewBuffer ( long size ) : byte[]

메소드 상세

Allocate() 공개 메소드

public Allocate ( int size ) : ArraySegment
size int
리턴 ArraySegment

Free() 공개 메소드

public Free ( ArraySegment segment ) : void
segment ArraySegment
리턴 void

SmartBufferPool() 공개 메소드

public SmartBufferPool ( int maxMemoryUsageMb, int initialSizeMb, int extraBufferSizeMb ) : System
maxMemoryUsageMb int
initialSizeMb int
extraBufferSizeMb int
리턴 System

프로퍼티 상세

ExtraMemoryUsage 공개적으로 프로퍼티

public long ExtraMemoryUsage
리턴 long

InitialMemoryUsage 공개적으로 프로퍼티

public long InitialMemoryUsage
리턴 long

MaxBuffersCount 공개적으로 프로퍼티

public long MaxBuffersCount
리턴 long

MaxMemoryUsage 공개적으로 프로퍼티

public long MaxMemoryUsage
리턴 long