summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-04-07 12:25:20 +0900
committerNobuyoshi Nakada <[email protected]>2023-04-07 13:42:58 +0900
commit4adcfc8cd7a17593a6590025da2b03eebf4fd63c ()
tree1ad3a478918b37dc266bafafad40c95145037815
parentf99af439805fe51b38aa1cf79f9c657f857510f4 (diff)
[Bug #19584] [DOC] Tweek description of `rb_gc_register_address`
-rw-r--r--gc.c12
-rw-r--r--include/ruby/internal/gc.h13
2 files changed, 18 insertions, 7 deletions
@@ -9209,10 +9209,16 @@ rb_gc_register_address(VALUE *addr)
tmp->varptr = addr;
global_list = tmp;
- /* obj has to be guarded here because the allocation above could trigger a
- * GC. However, C extensions could pass a pointer to a global variable
- * which does not exist on the stack and thus could get swept. */
RB_GC_GUARD(obj);
}
void
@@ -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.
*/
void rb_gc_register_address(VALUE *valptr);