[ruby-cvs:64642] normal:r57476 (trunk): time.c (time_strftime): avoid garbage in common case

normal at ruby-lang.org normal at ruby-lang.org
Tue Jan 31 11:18:58 JST 2017


normal	2017-01-31 11:18:58 +0900 (Tue, 31 Jan 2017)

  New Revision: 57476

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

  Log:
    time.c (time_strftime): avoid garbage in common case
    
    strftime format strings which are dynamically-generated will benefit
    from avoiding garbage, here.
    
    * time.c (time_strftime): use rb_str_tmp_frozen_{acquire,release}
    * test/ruby/test_time.rb (test_strftime_no_hidden_garbage): new test

  Modified files:
    trunk/test/ruby/test_time.rb
    trunk/time.c


More information about the ruby-cvs mailing list