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