Patent ID: 8214614

Claim:
A machine-implemented method for mapping a non-page aligned memory buffer to an address space of a process: determining whether the memory buffer starts on a first page boundary; determining whether the memory buffer ends on a second page boundary; when the memory buffer is determined not to start on the first page boundary and the memory buffer is determined to end on the second page boundary, performing: copying data from a beginning portion of the memory buffer within a first original memory page to a first memory page, and mapping a safe buffer to the address space of the process, the safe buffer residing in the first memory page and all original memory pages of the memory buffer except for the first original memory page; and when the memory buffer is determined to start on the first page boundary and the memory buffer is determined not to end on the second page boundary, performing: copying data from an ending portion of the memory buffer within a second original memory page to a second memory page, and mapping the safe buffer to the address space of the process, the safe buffer residing in the second memory page and all original memory pages of the memory buffer except for the second original memory page.