Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Revert "[EXPERIMENTAL] Make Symbol#to_s return a frozen String [Feature #16150]" | NARUSE, Yui | 2019-11-05 | 1 | -3/+1 |
| | | | | This reverts commit 6ffc045a817fbdf04a6945d3c260b55b0fa1fd1e. | ||||
* | [EXPERIMENTAL] Make Symbol#to_s return a frozen String | Benoit Daloze | 2019-09-26 | 1 | -1/+3 |
| | | | | | | * Always the same frozen String for a given Symbol. * Avoids extra allocations whenever calling Symbol#to_s. * See [Feature #16150] | ||||
* | Resize capacity for fstring | John Hawthorn | 2019-06-26 | 1 | -0/+19 |
| | | | | | | | | | | | | | | | | | | | | | | | When a string is #frozen, it's capacity is resized to fit (if it is much larger), since we know it will no longer be mutated. > puts ObjectSpace.dump(String.new("a"*30, capacity: 1000)) {"type":"STRING", "class":"0x7feaf00b7bf0", "bytesize":30, "capacity":1000, "value":"... > puts ObjectSpace.dump(String.new("a"*30, capacity: 1000).freeze) {"type":"STRING", "class":"0x7feaf00b7bf0", "frozen":true, "bytesize":30, "value":"... (ObjectSpace.dump doesn't show capacity if capacity is equal to bytesize) Previously, if we dedup into an fstring, using String#-@, capacity would not be reduced. > puts ObjectSpace.dump(-String.new("a"*30, capacity: 1000)) {"type":"STRING", "class":"0x7feaf00b7bf0", "frozen":true, "fstring":true, "bytesize":30, "capacity":1000, "value":"... This commit makes rb_fstring call rb_str_resize, the same as rb_str_freeze does. Closes: https://github.com/ruby/ruby/pull/2256 | ||||
* | Fixed misspelling words. | hsbt | 2017-10-22 | 1 | -1/+1 |
| | | | | | | These are detected by https://github.com/client9/misspell git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e | ||||
* | io.c: shrink read buffer | nobu | 2017-08-31 | 1 | -0/+8 |
| | | | | | | | | | * io.c (io_setstrbuf): return true if the buffer is newly created. * io.c (io_set_read_length): shrink the read buffer if it is a new object and is too large. [ruby-core:81370] [Bug #13597] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e | ||||
* | * string.c (rb_str_init): introduce String.new(capacity: size) | naruse | 2016-02-17 | 1 | -3/+16 |
| | | | | | | [Feature #12024] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e | ||||
* | * test/-ext-/string/test_capacity.rb: Added missing library. | hsbt | 2016-01-27 | 1 | -0/+1 |
| | | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e | ||||
* | Add tests about String's internal capacity | naruse | 2016-01-27 | 1 | -0/+18 |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |