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.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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