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