[前][次][番号順一覧][スレッド一覧]

ruby-changes:63823

From: Alan <ko1@a...>
Date: Wed, 2 Dec 2020 05:23:41 +0900 (JST)
Subject: [ruby-changes:63823] 56141d38a3 (master): Fix docs about movement for rb_gc_register_mark_object()

https://git.ruby-lang.org/ruby.git/commit/?id=56141d38a3

From 56141d38a3f3910d883e1dde754998ce10b79a58 Mon Sep 17 00:00:00 2001
From: Alan Wu <XrXr@u...>
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.

diff --git a/include/ruby/internal/gc.h b/include/ruby/internal/gc.h
index 69ff619..d94f8a3 100644
--- a/include/ruby/internal/gc.h
+++ b/include/ruby/internal/gc.h
@@ -45,10 +45,8 @@ void rb_global_variable(VALUE *); https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/gc.h#L45
 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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]