1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
<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">
<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 434.
<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>»</td>
<td><tt>false</tt></td>
</tr>
<tr>
<td><tt>GC.disable</tt></td>
<td>»</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>»</td>
<td><tt>false</tt></td>
</tr>
<tr>
<td><tt>GC.enable</tt></td>
<td>»</td>
<td><tt>true</tt></td>
</tr>
<tr>
<td><tt>GC.enable</tt></td>
<td>»</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>»</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>»</td>
<td><tt>nil</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
</desc>
</method>
<p/>
</methods>
<p/>
</class>
</ppdoc>
|