<ppdoc>
<copyright>
    Copyright (c) 2001 by Addison Wesley Longman.  This
    material may be distributed only subject to the terms and
    conditions set forth in the Open Publication License, v1.0 or
    later (the latest version is presently available at
    http://www.opencontent.org/openpub/).
</copyright>
<class name="GC" type="module" ref="xref-000001">
<p/>
  The <modulename>GC</modulename> module provides an interface to Ruby's mark and sweep garbage
  collection mechanism.  
  Some of the underlying methods are also
  available via the <modulename>ObjectSpace</modulename> module, described 
  beginning on page 430.
<p/>
  <methods type="class">
        <method name="disable" ref="disable">
      <callseq>
        GC.disable <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Disables garbage collection, returning <const>true</const> if garbage
      collection was already disabled.
<p/>
<codefragment>
<fullcode><![CDATA[        GC.disable
        GC.disable
]]></fullcode><rubycode>
<tr>
  <td><tt>GC.disable</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
<tr>
  <td><tt>GC.disable</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="enable" ref="enable">
      <callseq>
        GC.enable <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Enables garbage collection, returning <const>true</const> if garbage
      collection was disabled.
<p/>
<codefragment>
<fullcode><![CDATA[        GC.disable
        GC.enable
        GC.enable
]]></fullcode><rubycode>
<tr>
  <td><tt>GC.disable</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
<tr>
  <td><tt>GC.enable</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
<tr>
  <td><tt>GC.enable</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="start" ref="start">
      <callseq>
        GC.start <returns><tt>nil</tt></returns>
      </callseq>
      <desc>
<p/>
      Initiates garbage collection, unless manually disabled.
<p/>
<codefragment>
<fullcode><![CDATA[        GC.start
]]></fullcode><rubycode>
<tr>
  <td><tt>GC.start</tt></td>
  <td>&#187;</td>
  <td><tt>nil</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
  </methods>
<p/>
  <methods type="instance">
        <method name="garbage_collect" ref="garbage_collect">
      <callseq>
        garbage_collect <returns><tt>nil</tt></returns>
      </callseq>
      <desc>
<p/>
      Equivalent to <mmm><file>gc</file><front>GC</front><back>start</back><mref>start</mref></mmm>.
<p/>
<codefragment>
<fullcode><![CDATA[        include GC
        garbage_collect
]]></fullcode><rubycode>
<tr>
<td colspan="3"><tt>include<nbsp/>GC</tt></td>
</tr>
<tr>
  <td><tt>garbage_collect</tt></td>
  <td>&#187;</td>
  <td><tt>nil</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
  </methods>
<p/>
</class>
</ppdoc>
