From 56141d38a3f3910d883e1dde754998ce10b79a58 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Wed, 25 Nov 2020 17:33:09 -0500 Subject: Fix docs about movement for rb_gc_register_mark_object() This API in fact pins objects passed to it. See vm.c:2546. --- include/ruby/internal/gc.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/ruby') diff --git a/include/ruby/internal/gc.h b/include/ruby/internal/gc.h index 69ff6193d8..d94f8a3736 100644 --- a/include/ruby/internal/gc.h +++ b/include/ruby/internal/gc.h @@ -45,10 +45,8 @@ void rb_global_variable(VALUE *); 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. + * Inform the garbage collector that `object` is a live Ruby object that should + * not be moved. * * See also: rb_gc_register_address() */ -- cgit v1.2.3