diff options
Diffstat (limited to 'include/ruby')
| -rw-r--r-- | include/ruby/internal/gc.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/ruby/internal/gc.h b/include/ruby/internal/gc.h index 66fc14e511..054e4b0f9c 100644 --- a/include/ruby/internal/gc.h +++ b/include/ruby/internal/gc.h @@ -26,10 +26,15 @@ RBIMPL_SYMBOL_EXPORT_BEGIN() /** - * 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. + * Inform the garbage collector that the global or static variable pointed by + * `valptr` stores 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. + * + * Because this registration itself has a possibility to trigger a GC, this + * function must be called before any GC-able objects is assigned to the + * address pointed by `valptr`. */ void rb_gc_register_address(VALUE *valptr); |
