![]() |
LockMemoryContiguous |
||||
Header: | MacMemory.h | Carbon status: | Unsupported | |
Makes a portion of the address space immovable in physical memory and ineligible for paging.
OSErr LockMemoryContiguous ( void *address, UInt32 count );
A pointer indicating the starting address of the range of memory to be locked in RAM.
The size, in bytes, of the range of memory to be locked in RAM.
A result code. A result code.
The LockMemoryContiguous function attempts to obtain a contiguous block of physical memory associated with the specified logical address range.
LockMemoryContiguous is exactly like the LockMemory function, except that LockMemoryContiguous attempts to obtain a contiguous block of physical memory associated with the specified logical address range. It might not be possible to make a range physically contiguous if any of the pages contained in the range are already locked.
If the starting address you supply to the LockMemory function is not on a page boundary, LockMemoryContiguous rounds down to the nearest page boundary. Similarly, if the specified range does not end on a page boundary, LockMemoryContiguous rounds up the value you pass in the count parameter so that the entire range of memory is locked.
Because a call to LockMemoryContiguous is not guaranteed to succeed, all code that uses LockMemoryContiguous must have an alternate method for locking the necessary ranges of memory. In general, you should avoid using LockMemoryContiguous if at all possible. If you must call it, do so as early as possiblepreferably at system startup timeto increase the likelihood that enough contiguous memory can be found.
Not supported in Carbon. Not available in CarbonLib, but available when InterfaceLib 7.1 or later is installed. Exported by InterfaceLib 7.1 and later.