[ruby-core:63057] [ruby-trunk - Feature #9894] [RFC] README.EXT: document rb_gc_register_mark_object

From: ko1@...
Date: 2014-06-10 08:58:42 UTC
List: ruby-core #63057
Issue #9894 has been updated by Koichi Sasada.


 (2014/05/31 4:56), Eric Wong wrote:
 > +void rb_gc_register_mark_object(VALUE val)
 > +
 > +  Tells GC to protect the object referenced by val.  This requires less
 > +  memory to track than rb_global_variable, but may only be used if the C
 > +  variable never changes.
 > +
 
 How about that?
 
 > Tells GC to protect the object referenced by val.
 
 Another things are implementation details.
 
 And I'm not sure the following sentence is needed.
 
 > but may only be used if the C
 > variable never changes.
 
 I think it may assume global variables. But this API is independent from
 C's global variables. I think this comment may be for
 `rb_global_variable' users, but it is different API.
 
 
 PS.
 For our MVM development, we can not support "rb_global_variable()". So I
 want to make it obsolete.
 This is why I introduce rb_gc_register_mark_object(). But not yet.
 
 -- 
 // SASADA Koichi at atdot dot net

----------------------------------------
Feature #9894: [RFC] README.EXT: document rb_gc_register_mark_object
https://bugs.ruby-lang.org/issues/9894#change-47135

* Author: Eric Wong
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
 Any comment on officially supporting this as part of the C API?
 
 diff --git a/README.EXT b/README.EXT
 index d66d6c5..dded850 100644
 --- a/README.EXT
 +++ b/README.EXT
 @@ -1176,6 +1176,12 @@ void rb_global_variable(VALUE *var)
  
    Tells GC to protect these variables.
  
 +void rb_gc_register_mark_object(VALUE val)
 +
 +  Tells GC to protect the object referenced by val.  This requires less
 +  memory to track than rb_global_variable, but may only be used if the C
 +  variable never changes.
 +
  == Constant Definition
  
  void rb_define_const(VALUE klass, const char *name, VALUE val) ::
 -- 
 Eric Wong



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next