From 4adcfc8cd7a17593a6590025da2b03eebf4fd63c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 7 Apr 2023 12:25:20 +0900 Subject: [Bug #19584] [DOC] Tweek description of `rb_gc_register_address` --- include/ruby/internal/gc.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'include/ruby') 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); -- cgit v1.2.3