C# 클래스 Microsoft.Isam.Esent.Interop.MemoryCache

Cache allocated chunks of memory that are needed for very short periods of time. The memory is not zeroed on allocation.
파일 보기 프로젝트 열기: ayende/managed-esent 1 사용 예제들

공개 메소드들

메소드 설명
Allocate ( ) : byte[]

Allocates a chunk of memory. If memory is cached it is returned. If no memory is cached then it is allocated. Check the size of the returned buffer to determine how much memory was allocated.

Free ( byte data ) : void

Frees an unused buffer. This may be added to the cache.

MemoryCache ( int bufferSize, int maxCachedBuffers ) : System

Initializes a new instance of the MemoryCache class.

비공개 메소드들

메소드 설명
GetStartingOffset ( ) : int

Get the offset in the cached buffers array to start allocating or freeing buffers to. This is done so that all threads don't start operating on slot zero, which would increase contention.

메소드 상세

Allocate() 공개 메소드

Allocates a chunk of memory. If memory is cached it is returned. If no memory is cached then it is allocated. Check the size of the returned buffer to determine how much memory was allocated.
public Allocate ( ) : byte[]
리턴 byte[]

Free() 공개 메소드

Frees an unused buffer. This may be added to the cache.
public Free ( byte data ) : void
data byte The memory to free.
리턴 void

MemoryCache() 공개 메소드

Initializes a new instance of the MemoryCache class.
public MemoryCache ( int bufferSize, int maxCachedBuffers ) : System
bufferSize int /// The size of the buffers to cache. ///
maxCachedBuffers int /// The maximum number of buffers to cache. ///
리턴 System