Next: Default Memory Manager, Previous: Memory Object Locking, Up: External Memory Management
The function
memory_object_get_attributeretrieves the current attributes associated with the memory object.The argument memory_control is the port, provided by the kernel in a
memory_object_initcall, to which cache management requests may be issued. If object_ready is set, the kernel may issue new data and unlock requests on the associated memory object. If may_cache_object is set, the kernel may keep data associated with this memory object, even after virtual memory references to it are gone. copy_strategy tells how the kernel should copy regions of the associated memory object.This routine does not receive a reply message (and consequently has no return value), so only message transmission errors apply.
The function
memory_object_change_attributesets performance-related attributes for the specified memory object. If the caching attribute is asserted, the kernel is permitted (and encouraged) to maintain cached data for this memory object even after no virtual address space contains this data.There are three possible caching strategies:
MEMORY_OBJECT_COPY_NONEwhich specifies that nothing special should be done when data in the object is copied;MEMORY_OBJECT_COPY_CALLwhich specifies that the memory manager should be notified via amemory_object_copycall before any part of the object is copied; andMEMORY_OBJECT_COPY_DELAYwhich guarantees that the memory manager does not externally modify the data so that the kernel can use its normal copy-on-write algorithms.MEMORY_OBJECT_COPY_DELAYis the strategy most commonly used.The argument memory_control is the port, provided by the kernel in a
memory_object_initcall, to which cache management requests may be issued. If may_cache_object is set, the kernel may keep data associated with this memory object, even after virtual memory references to it are gone. copy_strategy tells how the kernel should copy regions of the associated memory object. reply_to is a port on which amemory_object_change_completedcall will be issued upon completion of the attribute change, orMACH_PORT_NULLif no acknowledgement is desired.This routine does not receive a reply message (and consequently has no return value), so only message transmission errors apply.
The function
memory_object_change_completedindicates the completion of an attribute change call.
The following interface is obsoleted by memory_object_ready and
memory_object_change_attributes. If the old form
memory_object_set_attributes is used to make a memory object
ready, the kernel will write back data using the old
memory_object_data_write interface rather than
memory_object_data_return..
The function
memory_object_set_attributecontrols how the memory object. The kernel will only make data or unlock requests when the ready attribute is asserted. If the caching attribute is asserted, the kernel is permitted (and encouraged) to maintain cached data for this memory object even after no virtual address space contains this data.There are three possible caching strategies:
MEMORY_OBJECT_COPY_NONEwhich specifies that nothing special should be done when data in the object is copied;MEMORY_OBJECT_COPY_CALLwhich specifies that the memory manager should be notified via amemory_object_copycall before any part of the object is copied; andMEMORY_OBJECT_COPY_DELAYwhich guarantees that the memory manager does not externally modify the data so that the kernel can use its normal copy-on-write algorithms.MEMORY_OBJECT_COPY_DELAYis the strategy most commonly used.The argument memory_control is the port, provided by the kernel in a
memory_object_initcall, to which cache management requests may be issued. If object_ready is set, the kernel may issue new data and unlock requests on the associated memory object. If may_cache_object is set, the kernel may keep data associated with this memory object, even after virtual memory references to it are gone. copy_strategy tells how the kernel should copy regions of the associated memory object.This routine does not receive a reply message (and consequently has no return value), so only message transmission errors apply.