Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Memory mapping

A memory region can be mapped to contiguous pages in physical memory by specifying appropriate flags when the region is created. To access the address space associated with a memory region, the region (or one received from another process via IRemote) must be mapped using IMemSpace_MapRegion(). Not all pages of a memory region may be committed (mapped to physical memory).

Memory mapping increases the reference count of the memory region. A memory region cannot be released until the reference count is zero.

The following interfaces provide region and memory mapping functionality:

  • IMemGroup provides a way to create memory regions. The caller specifies sharing attributes for the memory group when creating the memory region.
  • IMemSpace provides a way to map a memory region into the process address space.
  • IMemMap maps part or all of a memory region to a physical address space. An IMemMap object is obtained by mapping a memory region using IMemSpace_MapRegion.

The following figure shows an example of in-process memory maps: