xref: /xnu-10002.1.13/osfmk/man/memory_object_destroy.html (revision 1031c584a5e37aff177559b9f69dbd3c8c3fd30a)
1*1031c584SApple OSS Distributions<h2>memory_object_destroy</h2>
2*1031c584SApple OSS Distributions<hr>
3*1031c584SApple OSS Distributions<p>
4*1031c584SApple OSS Distributions<strong>Function</strong> - Shut down a memory object.
5*1031c584SApple OSS Distributions<h3>SYNOPSIS</h3>
6*1031c584SApple OSS Distributions<pre>
7*1031c584SApple OSS Distributions<strong>kern_return_t   memory_object_destroy</strong>
8*1031c584SApple OSS Distributions                <strong>(memory_object_control_t</strong>         <var>memory_control</var>,
9*1031c584SApple OSS Distributions                 <strong>kern_return_t</strong>                           <var>reason</var><strong>);</strong>
10*1031c584SApple OSS Distributions</pre>
11*1031c584SApple OSS Distributions<h3>PARAMETERS</h3>
12*1031c584SApple OSS Distributions<dl>
13*1031c584SApple OSS Distributions<p>
14*1031c584SApple OSS Distributions<dt> <var>memory_control</var>
15*1031c584SApple OSS Distributions<dd>
16*1031c584SApple OSS Distributions[in memory-cache-control send right]
17*1031c584SApple OSS DistributionsThe memory cache control port
18*1031c584SApple OSS Distributionsto be used by the memory manager for cache management requests.
19*1031c584SApple OSS DistributionsThis port is provided by the kernel in a <strong>memory_object_init</strong> call.
20*1031c584SApple OSS Distributions<p>
21*1031c584SApple OSS Distributions<dt> <var>reason</var>
22*1031c584SApple OSS Distributions<dd>
23*1031c584SApple OSS Distributions[in scalar]
24*1031c584SApple OSS DistributionsAn error code indicating when the object must be destroyed.
25*1031c584SApple OSS Distributions</dl>
26*1031c584SApple OSS Distributions<h3>DESCRIPTION</h3>
27*1031c584SApple OSS Distributions<p>
28*1031c584SApple OSS DistributionsThe <strong>memory_object_destroy</strong> function tells the kernel to shut down the
29*1031c584SApple OSS Distributionsspecified memory object.  As a result of this call, the kernel
30*1031c584SApple OSS Distributionsno longer supports
31*1031c584SApple OSS Distributionspaging activity or any memory object calls on the memory object.
32*1031c584SApple OSS DistributionsThe kernel issues
33*1031c584SApple OSS Distributionsa <strong>memory_object_terminate</strong> call to pass to the memory
34*1031c584SApple OSS Distributionsmanager all rights to
35*1031c584SApple OSS Distributionsthe memory object port and the memory control port.
36*1031c584SApple OSS Distributions<p>
37*1031c584SApple OSS DistributionsTo ensure that any modified cached data is returned before the object is
38*1031c584SApple OSS Distributionsterminated, the memory manager should call <strong>memory_object_lock_request</strong>
39*1031c584SApple OSS Distributionswith
40*1031c584SApple OSS Distributions<var>should_flush</var> set and a
41*1031c584SApple OSS Distributionslock value of <strong>VM_PROT_WRITE</strong> before it makes the
42*1031c584SApple OSS Distributions<strong>memory_object_destroy</strong> call.
43*1031c584SApple OSS Distributions<h3>NOTES</h3>
44*1031c584SApple OSS Distributions<p>
45*1031c584SApple OSS DistributionsThe <var>reason</var> code is currently ignored by the kernel.
46*1031c584SApple OSS Distributions<h3>RETURN VALUES</h3>
47*1031c584SApple OSS Distributions<p>
48*1031c584SApple OSS DistributionsOnly generic errors apply.
49*1031c584SApple OSS Distributions<h3>RELATED INFORMATION</h3>
50*1031c584SApple OSS Distributions<p>
51*1031c584SApple OSS DistributionsFunctions:
52*1031c584SApple OSS Distributions<a href="memory_object_lock_request.html"><strong>memory_object_lock_request</strong></a>,
53*1031c584SApple OSS Distributions<a href="memory_object_terminate.html"><strong>memory_object_terminate</strong></a>.
54