INtime SDK Help
INtime SDK v7.1 > About INtime > INtime Kernel > Memory management > FreeRtMemory

Frees physical memory associated with the calling thread's virtual address space.

DWORD FreeRtMemory(
    PVOID pAddress,    // location of memory to be freed within calling thread's virtual segment


Offset within the calling thread's virtual address space where the physical memory is to be freed.


The virtual memory at the address referenced by pAddress is freed, up to the end of the allocation.

If the value of pAddress was originally returned from a call to AllocateRtMemory, the operation also frees all contiguous physical memory that is found at address, even if the contiguous block begins before offset. In other words, FreeRtMemory deletes all memory previously allocated from a single call to AllocateRtMemory.

If the physical memory pointed to by offset was mapped by a previous call to MapRtPhysicalMemory or MapRtPhysicalMemoryEx or MapRtSharedMemory, no physical memory is deallocated.

Return Values

The number of bytes freed
Failure. To determine the status, call GetLastRtError.


E_OK 0x0000
No exceptional conditions occurred.
The requested area of the virtual segment has no associated physical memory.
pAddress is invalid. One of these conditions exist:
  • All or part of pAddress is outside the calling thread's virtual address space.
  • The virtual address space has no associated physical memory.


Versions Defined in Include Link to
INtime 3.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also