Ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e0ba6b95ab71a441357ed5484e33498)
|
Registering values to the GC. More...
Go to the source code of this file.
Functions | |
void | rb_gc_register_address (VALUE *valptr) |
Inform the garbage collector that valptr points to a live Ruby object that should not be moved. More... | |
void | rb_global_variable (VALUE *) |
An alias for rb_gc_register_address() . More... | |
void | rb_gc_unregister_address (VALUE *valptr) |
Inform the garbage collector that a pointer previously passed to rb_gc_register_address() no longer points to a live Ruby object. More... | |
void | rb_gc_register_mark_object (VALUE object) |
Inform the garbage collector that object is a live Ruby object that should not be moved. More... | |
Registering values to the GC.
RBIMPL
or rbimpl
are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__
is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. Definition in file gc.h.
void rb_gc_register_address | ( | VALUE * | valptr | ) |
Inform the garbage collector that valptr
points to a live Ruby object that should not be moved.
Note that extensions should use this API on global constants instead of assuming constants defined in Ruby are always alive. Ruby code can remove global constants.
Definition at line 8707 of file gc.c.
Referenced by rb_global_variable(), and ruby_init_loadpath().
void rb_gc_register_mark_object | ( | VALUE | object | ) |
Inform the garbage collector that object
is a live Ruby object that should not be moved.
See also: rb_gc_register_address()
Definition at line 8686 of file gc.c.
Referenced by rb_define_const(), rb_profile_frame_absolute_path(), and ruby_process_options().
void rb_gc_unregister_address | ( | VALUE * | valptr | ) |
Inform the garbage collector that a pointer previously passed to rb_gc_register_address()
no longer points to a live Ruby object.
void rb_global_variable | ( | VALUE * | var | ) |
An alias for rb_gc_register_address()
.