Allocates memory from the current process' memory pool to the current thread's virtual address space.
PVOID AllocateRtMemory( DWORD cbSize // number of bytes to allocate );
cbSize
Each process is created with its own virtual address space. All threads within this process share their virtual address space. This call allocates page-aligned pages of physical memory into this virtual address space for use by the calling thread. The call automatically rounds up cbSize (in bytes) to a multiple of 4K. The allocated pages are contiguous; they start and end on 4K boundaries.
The virtual address space manager finds an available space within the virtual address space of the process and returns a near pointer to the allocated physical memory. The call fails if cbSize bytes of contiguous physical memory are not available, or if there is not enough virtual address space available in the virtual segment. The memory required for page tables is charged to the memory pool of the calling thread's process.
NULL
E_OK 0x0000
E_MEM 0x0002
E_VMEM 0x00F0
E_PARAM 0x8004
cbSize
contains a value larger than the virtual segment or 0 (zero). Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/rtbase.h | rt.h | rt.lib |