Carbon


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
);
Parameter descriptions
address

A pointer indicating the starting address of the range of memory to be locked in RAM.

count

The size, in bytes, of the range of memory to be locked in RAM.

function result

A result code. A result code.

DISCUSSION

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 possible—preferably at system startup time—to increase the likelihood that enough contiguous memory can be found.

AVAILABILITY

Not supported in Carbon. Not available in Carbon.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)