MemoryPoolAllocatePage Method

Requests a page from the buffered pool. If there is not a free one available, method will block and request a collection of unused pages by raising RequestCollection event.

Definition

Namespace: SnapDB.IO.Unmanaged
Assembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public void AllocatePage(
	out int index,
	out IntPtr addressPointer
)

Parameters

index  Int32
the index id of the page that was allocated
addressPointer  IntPtr
outputs a address that can be used to access this memory address. You cannot call release with this parameter. Use the returned index to release pages.

Remarks

IMPORTANT NOTICE: Be careful when calling this method as the calling thread will block if no memory is available to have a background collection to occur. There is a possibility for a deadlock if calling this method from within a lock. The page allocated will not be initialized, so assume that the data is garbage.

See Also