[ruby-cvs:64639] normal:r57473 (trunk): sprintf.c: avoid garbage in common (no exception) case

normal at ruby-lang.org normal at ruby-lang.org
Tue Jan 31 09:41:56 JST 2017


normal	2017-01-31 09:41:56 +0900 (Tue, 31 Jan 2017)

  New Revision: 57473

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

  Log:
    sprintf.c: avoid garbage in common (no exception) case
    
    Format strings which are dynamically-generated will benefit
    from this.  This won't cover exceptions, but exceptions for
    sprintf should be too uncommon to care about (unlike IO)
    
    * sprintf.c (rb_str_format): use rb_str_tmp_frozen_{acquire,release}
    * test/ruby/test_sprintf.rb (test_no_hidden_garbage): new test

  Modified files:
    trunk/sprintf.c
    trunk/test/ruby/test_sprintf.rb


More information about the ruby-cvs mailing list