[ruby-cvs:60679] normal:r53518 (trunk): resolve class name earlier and more consistently

normal at ruby-lang.org normal at ruby-lang.org
Wed Jan 13 04:26:07 JST 2016


normal	2016-01-13 04:26:07 +0900 (Wed, 13 Jan 2016)

  New Revision: 53518

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

  Log:
    resolve class name earlier and more consistently
    
    This further avoids class name resolution issues which came
    about due to relying on hash table ordering before r53376.
    
    Pre-caching the class name when it is never used raises memory
    use, but the overall gain from moving away from st still gives
    us a small gain.  Reverting r53376 and this patch and testing with
    "valgrind -v ./ruby -rrdoc -eexit" on x86 (32-bit) shows:
    
    before:
        in use at exit: 1,662,239 bytes in 25,286 blocks
      total heap usage: 49,514 allocs, 24,228 frees, 6,005,561 bytes allocated
    
    after, with this change:
        in use at exit: 1,646,529 bytes in 24,572 blocks
      total heap usage: 48,891 allocs, 24,319 frees, 6,003,921 bytes allocated
    
    * class.c (Init_class_hierarchy): resolve name for rb_cObject ASAP
    * object.c (rb_mod_const_set): move name resolution to rb_const_set
    * variable.c (rb_const_set): do class resolution here
      [ruby-core:72807] [Bug #11977]

  Modified files:
    trunk/ChangeLog
    trunk/class.c
    trunk/object.c
    trunk/variable.c


More information about the ruby-cvs mailing list