RtAllocateLocalMemory

RtAllocateLocalMemory allocates memory from a pre-allocated RTSS deterministic memory pool to avoid SRI activity if allocating memory from Windows memory pool.

Syntax

PVOID RtAllocateLocalMemory(
    ULONG Size
);

Parameters

Size

An unsigned long specifying the number of bytes to allocate.

Return Values

A pointer to the memory if the function succeeds, a NULL pointer if the function fails

Remarks

RtAllocateLocalMemory allocates memory in the virtual address space of the process, backed by non-paged physical memory. Since RtAllocateLocalMemory allocates memory from a pre-allocated RTSS memory pool, this is a deterministic memory allocation call and can be called in a shutdown handler.

NOTE:  If the RTSS memory pool has not been created yet or if the amount of free memory in the pool is not enough for the requested Size, there is SRI activity involved in an RtAllocateLocalMemory call and the deterministic feature is lost. To avoid that, call RtQueryLocalMemory first to make sure there is enough free memory in RTSS memory pool.

Requirements

Header Rtapi.h
Library Rtx_Rtss.lib

See Also:

RtFreeLocalMemory

RtQueryLocalMemory

IntervalZero.com | Support | Give Feedback