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

Maps a memory area, previously created by another process using CreateRtMemoryHandle, into the current thread's memory space.

CAUTION:   This system call can set up an address space to refer to any area of physical memory, even if other descriptors already refer to that memory. Although this may be useful for aliasing purposes, do not overlap memory accidentally.
PVOID MapRtSharedMemory(
    RTHANDLE hSeg    // rthandle for previously created memory area
);

Parameters

hSeg
RTHANDLE for address space. Must have been created using CreateRtMemoryHandle.

Remarks

MapRtSharedMemory maps a memory area exposed by CreateRtMemoryHandle into the segment of the calling thread.

Use FreeRtMemory to delete the mapping created by this call and to free the virtual memory associated with it.

Shared Memory can be used on the local host to share same physical memory between processes on the same or even on different nodes. Memory cannot be shared directly between nodes on different systems. Use CopyRtData to update memory objects when they reside on different systems.

Return Values

An offset in the thread's virtual segment referencing the newly-mapped memory area.
Success.
NULL
Failure. To determine the status, call GetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_MEM 0x0002
Creating page table(s) for this request requires more available physical memory than currently exists.
E_VMEM 0x00F0
Satisfying this request requires more virtual memory than is available to the process.

Requirements

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