memory_object_destroy.html   [plain text]

<strong>Function</strong> - Shut down a memory object.
<strong>kern_return_t   memory_object_destroy</strong>
                <strong>(memory_object_control_t</strong>         <var>memory_control</var>,
                 <strong>kern_return_t</strong>                           <var>reason</var><strong>);</strong>
<dt> <var>memory_control</var> 
[in memory-cache-control send right]
The memory cache control port 
to be used by the memory manager for cache management requests. 
This port is provided by the kernel in a <strong>memory_object_init</strong> call.
<dt> <var>reason</var> 
[in scalar]
An error code indicating when the object must be destroyed.
The <strong>memory_object_destroy</strong> function tells the kernel to shut down the
specified memory object.  As a result of this call, the kernel
no longer supports
paging activity or any memory object calls on the memory object.
The kernel issues 
a <strong>memory_object_terminate</strong> call to pass to the memory
manager all rights to 
the memory object port and the memory control port.
To ensure that any modified cached data is returned before the object is
terminated, the memory manager should call <strong>memory_object_lock_request</strong>
<var>should_flush</var> set and a 
lock value of <strong>VM_PROT_WRITE</strong> before it makes the 
<strong>memory_object_destroy</strong> call.
The <var>reason</var> code is currently ignored by the kernel.
Only generic errors apply.
<a href="memory_object_lock_request.html"><strong>memory_object_lock_request</strong></a>,
<a href="memory_object_terminate.html"><strong>memory_object_terminate</strong></a>.