disable broken tests on net_4_0
[mcs.git] / docs / ecma334 / 25.3.xml
blob63ce5239da4f908e370e25e7bb21613432a0e128
1 <?xml version="1.0"?>
2 <clause number="25.3" title="Fixed and moveable variables">
3   <paragraph>The address-of operator (<hyperlink>25.5.4</hyperlink>) and the fixed statement (<hyperlink>25.6</hyperlink>) divide variables into two categories: Fixed variables and moveable variables. </paragraph>
4   <paragraph>Fixed variables reside in storage locations that are unaffected by operation of the garbage collector. </paragraph>
5   <paragraph>(Examples of fixed variables include local variables, value parameters, and variables created by dereferencing pointers.) On the other hand, moveable variables reside in storage locations that are subject to relocation or disposal by the garbage collector. (Examples of moveable variables include fields in objects and elements of arrays.) </paragraph>
6   <paragraph>The &amp; operator (<hyperlink>25.5.4</hyperlink>) permits the address of a fixed variable to be obtained without restrictions. However, because a moveable variable is subject to relocation or disposal by the garbage collector, the address of a moveable variable can only be obtained using a fixed statement (<hyperlink>25.6</hyperlink>), and that address remains valid only for the duration of that fixed statement. </paragraph>
7   <paragraph>In precise terms, a fixed variable is one of the following: <list><list_item> A variable resulting from a <non_terminal where="14.5.2">simple-name</non_terminal> (<hyperlink>14.5.2</hyperlink>) that refers to a local variable or a value parameter. </list_item><list_item> A variable resulting from a <non_terminal where="14.5.4">member-access</non_terminal> (<hyperlink>14.5.4</hyperlink>) of the form V.I, where V is a fixed variable of a <non_terminal where="11.1">struct-type</non_terminal>. </list_item><list_item> A variable resulting from a <non_terminal where="25.5.1">pointer-indirection-expression</non_terminal> (<hyperlink>25.5.1</hyperlink>) of the form *P, a  <non_terminal where="25.5.2">pointer-member-access</non_terminal> (<hyperlink>25.5.2</hyperlink>) of the form P-&gt;I, or a <non_terminal where="25.5.3">pointer-element-access</non_terminal> (<hyperlink>25.5.3</hyperlink>) of the form P[E]. </list_item></list></paragraph>
8   <paragraph>All other variables are classified as moveable variables. </paragraph>
9   <paragraph>Note that a static field is classified as a moveable variable. Also note that a ref or out parameter is classified as a moveable variable, even if the argument given for the parameter is a fixed variable. Finally, note that a variable produced by dereferencing a pointer is always classified as a fixed variable. </paragraph>
10 </clause>