[ruby-cvs:57826] normal:r50678 (trunk): variable.c: use indices for generic ivars

normal at ruby-lang.org normal at ruby-lang.org
Sat May 30 08:42:50 JST 2015


normal	2015-05-30 08:42:49 +0900 (Sat, 30 May 2015)

  New Revision: 50678

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50678

  Log:
    variable.c: use indices for generic ivars
    
    This reduces memory overhead of ivars for common types such as
    T_DATA the same way T_OBJECT does it.
    
    For 9992 accepted clients on an OpenSSL server, this reduces
    memory from 77160K to 69248K with the script in
    https://bugs.ruby-lang.org/issues/11170
    
    * variable.c (static int special_generic_ivar): move
      (rb_generic_ivar_table): rewrite for compatibility
      (gen_ivtbl_bytes): new function
      (generic_ivar_get): update to use ivar index
      (generic_ivar_update): ditto
      (generic_ivar_set): ditto
      (generic_ivar_defined): ditto
      (generic_ivar_remove): ditto
      (rb_mark_generic_ivar): ditto
      (givar_i): ditto
      (rb_free_generic_ivar): ditto
      (rb_mark_generic_ivar_tbl): ditto
      (rb_generic_ivar_memsize): ditto
      (rb_copy_generic_ivar): ditto
      (rb_ivar_set): ditto
      (rb_ivar_foreach): ditto
      (rb_ivar_count): ditto
      (givar_mark_i): remove
      (gen_ivtbl_mark): new function
      (gen_ivar_each): ditto
      (iv_index_tbl_extend): update for struct ivar_update
      (iv_index_tbl_newsize): ditto
      [ruby-core:69323] [Feature #11170]

  Modified files:
    trunk/ChangeLog
    trunk/variable.c


More information about the ruby-cvs mailing list