mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add docs for some C extension GC APIs
This commit is contained in:
parent
037803e092
commit
f234f2740d
Notes:
git
2020-11-07 02:56:05 +09:00
1 changed files with 28 additions and 4 deletions
|
@ -25,10 +25,34 @@
|
|||
|
||||
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
||||
|
||||
void rb_global_variable(VALUE*);
|
||||
void rb_gc_register_mark_object(VALUE);
|
||||
void rb_gc_register_address(VALUE*);
|
||||
void rb_gc_unregister_address(VALUE*);
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
void rb_gc_register_address(VALUE *valptr);
|
||||
|
||||
/**
|
||||
* An alias for `rb_gc_register_address()`.
|
||||
*/
|
||||
void rb_global_variable(VALUE *);
|
||||
|
||||
/**
|
||||
* Inform the garbage collector that a pointer previously passed to
|
||||
* `rb_gc_register_address()` no longer points to a live Ruby object.
|
||||
*/
|
||||
void rb_gc_unregister_address(VALUE *valptr);
|
||||
|
||||
/**
|
||||
* Inform the garbage collector that `object` is a live Ruby object. Note that
|
||||
* the garbage collector is free to move `object` and so it is not correct to
|
||||
* save `object` into a C global constant and assume that it will always refer
|
||||
* to the same Ruby object.
|
||||
*
|
||||
* See also: rb_gc_register_address()
|
||||
*/
|
||||
void rb_gc_register_mark_object(VALUE object);
|
||||
|
||||
RBIMPL_SYMBOL_EXPORT_END()
|
||||
|
||||
|
|
Loading…
Reference in a new issue