xref: /xnu-11215.61.5/osfmk/man/memory_object_attr_info.html (revision 4f1223e81cd707a65cc109d0b8ad6653699da3c4)
1*4f1223e8SApple OSS Distributions<h2>memory_object_attr_info</h2>
2*4f1223e8SApple OSS Distributions<hr>
3*4f1223e8SApple OSS Distributions<p>
4*4f1223e8SApple OSS Distributions<strong>Structure</strong> - Specifies memory object's behavior attributes.
5*4f1223e8SApple OSS Distributions<h3>SYNOPSIS</h3>
6*4f1223e8SApple OSS Distributions<pre>
7*4f1223e8SApple OSS Distributions<strong>struct  memory_object_attr_info</strong>
8*4f1223e8SApple OSS Distributions<strong>{</strong>
9*4f1223e8SApple OSS Distributions        <strong>memory_object_copy_strategy_t</strong>    <var>copy_strategy</var><strong>;</strong>
10*4f1223e8SApple OSS Distributions        <strong>vm_offset_t</strong>                       <var>cluster_size</var><strong>;</strong>
11*4f1223e8SApple OSS Distributions        <strong>boolean_t</strong>                            <var>may_cache</var><strong>;</strong>
12*4f1223e8SApple OSS Distributions        <strong>boolean_t</strong>                            <var>temporary</var><strong>;</strong>
13*4f1223e8SApple OSS Distributions<strong>};</strong>
14*4f1223e8SApple OSS Distributions
15*4f1223e8SApple OSS Distributions<strong>typedef struct memory_object_attr_info* memory_object_attr_info_t;</strong>
16*4f1223e8SApple OSS Distributions</pre>
17*4f1223e8SApple OSS Distributions<h3>FIELDS</h3>
18*4f1223e8SApple OSS Distributions<dl>
19*4f1223e8SApple OSS Distributions<dt> <var>copy_strategy</var>
20*4f1223e8SApple OSS Distributions<dd>
21*4f1223e8SApple OSS DistributionsHow the kernel should handle copying of regions associated with the
22*4f1223e8SApple OSS Distributionsmemory object.  The copy strategy cannot be changed once an object is
23*4f1223e8SApple OSS Distributionsinitialized.  Valid values are:
24*4f1223e8SApple OSS Distributions<dl>
25*4f1223e8SApple OSS Distributions<p>
26*4f1223e8SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_NONE</strong>
27*4f1223e8SApple OSS Distributions<dd>
28*4f1223e8SApple OSS DistributionsUse normal procedure when copying the memory object's
29*4f1223e8SApple OSS Distributionsdata.  Normally, the kernel requests each page with read
30*4f1223e8SApple OSS Distributionsaccess, copies the data, and then (optionally) flushes the data.
31*4f1223e8SApple OSS Distributions<p>
32*4f1223e8SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_CALL</strong>
33*4f1223e8SApple OSS Distributions<dd>
34*4f1223e8SApple OSS DistributionsCall the memory manager when a copy operation is necessary.
35*4f1223e8SApple OSS Distributions<p>
36*4f1223e8SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_DELAY</strong>
37*4f1223e8SApple OSS Distributions<dd>
38*4f1223e8SApple OSS DistributionsUse copy-on-write technique.  This strategy allows the kernel
39*4f1223e8SApple OSS Distributionsto efficiently copy large amounts of data and guarantees that
40*4f1223e8SApple OSS Distributionsthe memory manager will not externally modify the data.  It is
41*4f1223e8SApple OSS Distributionsthe most commonly used copy strategy.
42*4f1223e8SApple OSS Distributions<p>
43*4f1223e8SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_TEMPORARY</strong>
44*4f1223e8SApple OSS Distributions<dd>
45*4f1223e8SApple OSS DistributionsAll changes are made in memory and the memory manager does not need
46*4f1223e8SApple OSS Distributionsto see them.
47*4f1223e8SApple OSS Distributions<p>
48*4f1223e8SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_SYMMETRIC</strong>
49*4f1223e8SApple OSS Distributions<dd>
50*4f1223e8SApple OSS DistributionsThe memory manager does not change the data, does not need to see
51*4f1223e8SApple OSS Distributionsany changes to the data, and will prevent the object from being
52*4f1223e8SApple OSS Distributionsmapped more than once.  Currently, this strategy should be restricted
53*4f1223e8SApple OSS Distributionsto use by the kernel.
54*4f1223e8SApple OSS Distributions</dl>
55*4f1223e8SApple OSS Distributions<p>
56*4f1223e8SApple OSS Distributions<dt> <var>cluster_size</var>
57*4f1223e8SApple OSS Distributions<dd>
58*4f1223e8SApple OSS DistributionsThe memory object's perferred cluster size (in bytes).  This value may affect
59*4f1223e8SApple OSS Distributionsthe number of pages transferred in a given paging operation.
60*4f1223e8SApple OSS Distributions<p>
61*4f1223e8SApple OSS Distributions<dt> <var>may_cache</var>
62*4f1223e8SApple OSS Distributions<dd>
63*4f1223e8SApple OSS DistributionsCache indicator.  If true, the kernel can cache data associated with the
64*4f1223e8SApple OSS Distributionsmemory object (keep the memory object active) even if no virtual
65*4f1223e8SApple OSS Distributionsmemory references to it remain.
66*4f1223e8SApple OSS Distributions<p>
67*4f1223e8SApple OSS Distributions<dt> <var>temporary</var>
68*4f1223e8SApple OSS Distributions<dd>
69*4f1223e8SApple OSS DistributionsIf TRUE, when the last mapping to the object is released,
70*4f1223e8SApple OSS Distributionsthe kernel destroys the object without returning any resident pages.
71*4f1223e8SApple OSS Distributions</dl>
72*4f1223e8SApple OSS Distributions<h3>DESCRIPTION</h3>
73*4f1223e8SApple OSS Distributions<p>
74*4f1223e8SApple OSS DistributionsThe <strong>memory_object_attr_info</strong> structure defines behavior and
75*4f1223e8SApple OSS Distributionsperformance relevant memory object attributes.
76*4f1223e8SApple OSS Distributions<h3>RELATED INFORMATION</h3>
77*4f1223e8SApple OSS Distributions<p>
78*4f1223e8SApple OSS DistributionsFunctions:
79*4f1223e8SApple OSS Distributions<a href="MO_get_attributes.html"><strong>memory_object_get_attributes</strong></a>,
80*4f1223e8SApple OSS Distributions<a href="MO_change_attributes.html"><strong>memory_object_change_attributes</strong></a>,
81*4f1223e8SApple OSS Distributions<a href="vm_region.html"><strong>vm_region</strong></a>,
82*4f1223e8SApple OSS Distributions<a href="memory_object_synchronize.html"><strong>memory_object_synchronize</strong></a>,
83*4f1223e8SApple OSS Distributions<a href="VSD_memory_manager.html"><strong>vm_set_default_memory_manager</strong></a>,
84*4f1223e8SApple OSS Distributions<a href="vm_msync.html"><strong>vm_msync</strong></a>.
85