INtime SDK Help
FreeRtMemory
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
);

Parameters

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

Remarks

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
Success.
-1
Failure. To determine the status, call GetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_NOT_ALLOCATED 0x00F2
The requested area of the virtual segment has no associated physical memory.
E_BAD_ADDR 0x800F
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.

Requirements

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