summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-07 12:25:20 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-07 13:42:58 +0900
commit4adcfc8cd7a17593a6590025da2b03eebf4fd63c (patch)
tree1ad3a478918b37dc266bafafad40c95145037815 /include
parentf99af439805fe51b38aa1cf79f9c657f857510f4 (diff)
downloadruby-4adcfc8cd7a17593a6590025da2b03eebf4fd63c.tar.gz
[Bug #19584] [DOC] Tweek description of `rb_gc_register_address`
Diffstat (limited to 'include')
-rw-r--r--include/ruby/internal/gc.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/ruby/internal/gc.h b/include/ruby/internal/gc.h
index bc81883e0e..205830954e 100644
--- a/include/ruby/internal/gc.h
+++ b/include/ruby/internal/gc.h
@@ -399,10 +399,15 @@ VALUE rb_gc_latest_gc_info(VALUE key_or_buf);
void rb_gc_adjust_memory_usage(ssize_t diff);
/**
- * 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);