<?xml version="1.0"?>
<clause number="25.3" title="Fixed and moveable variables">
  <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>
  <paragraph>Fixed variables reside in storage locations that are unaffected by operation of the garbage collector. </paragraph>
  <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>
  <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>
  <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>
  <paragraph>All other variables are classified as moveable variables. </paragraph>
  <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>
</clause>
