Patent ID: 7213098

Claim:
A method for handling sharing of a physical memory space between a first process and a second process, the method comprising: allocating a portion of the physical memory space and creating a buffer object responsive to a buffer object request, wherein one of the processes executes native code of a program and the other process executes safe language code of the program; mapping a first address range of the first process and a second address range of the second process to the allocated portion of the shared physical memory space, wherein the buffer object represents at least one of the address ranges, wherein address ranges in the first process overlap and/or nest; requesting, by the first process, an address range [A 2 , A 2 +S 2 ] that overlaps with a previously allocated address range [A 1 , A 1 +S 1 ], wherein A 1 and A 2 represent addresses in the first process and S 1 and S 2 represent memory space sizes; the second process, allocating an address range [A 2 ′, A 2 ′+S 2 ], wherein A 2 ′ represent addresses in the second process, mapping [A 2 ′, A 2 ′+(A 1 +S 1 −A 2 )] in the second process to a same first portion of the one or more physical memory spaces to which [A 2 , A 1 +S 1 ] in the first process is mapped, and mapping [A 2 ′+(A 1 +S 1 −A 2 +S 21 ] in the second process to a same second portion of the one or more physical memory spaces to which [A 1 +S 1 , A 2 +S 2 ] in the first process is mapped, wherein A 1 <A 2 <A 1 +S 1 <A 2 +S 2 .