Module: GC
- Defined in:
- gc.c
Overview
The GC
module provides an interface to Ruby’s mark and sweep garbage collection mechanism. Some of the underlying methods are also available via the ObjectSpace
module.
Class Method Summary collapse
-
.disable ⇒ Boolean
Disables garbage collection, returning
true
if garbage collection was already disabled. -
.enable ⇒ Boolean
Enables garbage collection, returning
true
if garbage collection was previously disabled. -
.start ⇒ Object
Initiates garbage collection, unless manually disabled.
Instance Method Summary collapse
-
#garbage_collect ⇒ Object
Initiates garbage collection, unless manually disabled.
Class Method Details
.disable ⇒ Boolean
203 204 205 206 207 208 209 210 |
# File 'gc.c', line 203
VALUE
rb_gc_disable()
{
int old = dont_gc;
dont_gc = Qtrue;
return old;
}
|
.enable ⇒ Boolean
182 183 184 185 186 187 188 189 |
# File 'gc.c', line 182
VALUE
rb_gc_enable()
{
int old = dont_gc;
dont_gc = Qfalse;
return old;
}
|
.start ⇒ nil .garbage_collect ⇒ nil .garbage_collect ⇒ nil
Initiates garbage collection, unless manually disabled.
1418 1419 1420 1421 1422 1423 |
# File 'gc.c', line 1418
VALUE
rb_gc_start()
{
rb_gc();
return Qnil;
}
|
Instance Method Details
#start ⇒ nil #garbage_collect ⇒ nil #garbage_collect ⇒ nil
Initiates garbage collection, unless manually disabled.
1418 1419 1420 1421 1422 1423 |
# File 'gc.c', line 1418
VALUE
rb_gc_start()
{
rb_gc();
return Qnil;
}
|