Project

General

Profile

Feature #11146

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

Even miniruby creates one generic ivar (plain "ruby" creates 9), 
 so there's no point in lazily allocating the table and increasing 
 lines of code. 

 I'll commit in a few days unless there's objections. 

 I dumped generic ivar counts with the following trivial patch: 

 ~~~patch 
 

   --- a/variable.c 
 
   +++ b/variable.c 
 
   @@ -24,6 +24,10 @@ static void check_before_mod_set(VALUE, ID, VALUE, const char *); 
  
    static void setup_const_entry(rb_const_entry_t *, VALUE, VALUE, rb_const_flag_t); 
  
    static int const_update(st_data_t *, st_data_t *, st_data_t, int); 
  
    static st_table *generic_iv_tbl; 
 
   +__attribute__((destructor)) static void count_genivar(void) 
 
   +{ 
 
   +      fprintf(stderr, "genivars: %zu\n", (size_t)generic_iv_tbl->num_entries); 
 
   +} 

  

    void 
  
    Init_var_tables(void) 
 ~~~ 

Back