ILNumerics Ultimate VS

MemoryPoolHandleTNew Method (UInt64, Boolean)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Request a memory chunk of minimal length length.

[ILNumerics Core Module]

Namespace:  ILNumerics.Core.MemoryLayer
Assembly:  ILNumerics.Core (in ILNumerics.Core.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public HandleT New(
	ulong length,
	bool init = false
)

Parameters

length
Type: SystemUInt64
Minimal length requested in bytes.
init (Optional)
Type: SystemBoolean
[Optional] True: returned cleared memory (zeros, 0 values); False (default): do not clear the memory.

Return Value

Type: HandleT
IntPtr to the memory chunk.
Exceptions

ExceptionCondition
OutOfMemoryException if no matching memory chunk was found in the pool and no memory of the requested length could be allocated from device memory.
Remarks

The memory will be taken from the pool if a matching chunk is available in the pool. Otherwise, a new chunk of memory is allocated from the Device's memory allocator.

'Matching' chunks are those chunks of memory stored in the pool which have the exact length requested or a higher length, within a certain interval. The Length property informs about the actual allocated length of the allocated memory chunk the returned pointer refers to.

During the retrieval / allocation of the requested memory chunk this function blocks other threads from modifying the pools state (lockfree, though).

[ILNumerics Core Module]

See Also

Reference