Contiguous Memory Mapping Functions
The following functions are available to access RTX64 contiguous memory allocation services:
- RtAllocateContiguousMemory allocates a physically contiguous memory address range and maps that memory into the process' virtual address space.
- RtAllocateContiguousMemorySpecifyCache allocates a physically contiguous memory address range and maps that memory into the process' virtual address space. This function can specify the type of caching allowed for the requested memory.
- RtFreeContiguousMemory frees a previously allocated physically contiguous memory region.
- RtGetPhysicalAddress returns the physical address for the virtual address of a previously allocated physically contiguous memory region.
Programming Considerations
Contiguous memory is always allocated from the non-paged pool of memory maintained by Windows. This pool of memory is relatively small and is rapidly fragmented by the allocations of other drivers and subsystems in Windows shortly after system boot. To avoid failure of large allocations, you should minimize their use and/or ensure that they are accomplished shortly after system boot.
In the Windows environment, RtGetPhysicalAddress operates only with addresses returned by RtAllocateContiguousMemory or RtAllocateContiguousMemorySpecifyCache.
Example
The RTX64 Contiguous Memory Allocation Calls Programming Example demonstrates the use of RTX64 contiguous memory allocation calls.
Related topics: