Age | Commit message (Collapse) | Author |
---|
| Previously we always reserved one more byte than necessary in the sprintf output string. Notes: Merged: https://github.com/ruby/ruby/pull/12029 |
| Although a binary (aka ASCII-8BIT) string will never have a broken coderange, it still has to differentiate between "valid" and "7bit". On Ruby 3.4/trunk this problem is masked because we now clear the coderange more agressively in rb_str_resize, and we happened to always be strinking this string, but we should not assume that. On Ruby 3.3 this created strings where `ascii_only?` was true in cases it shouldn't be as well as other problems. Fixes [Bug #20883] Co-authored-by: Daniel Colson <danieljamescolson@gmail.com> Co-authored-by: Matthew Draper <matthew@trebex.net> Notes: Merged: https://github.com/ruby/ruby/pull/12029 |
| `-FIXNUM_MIN` is usually greater than `FIXNUM_MAX` on platforms using two's complement representation. Notes: Merged: https://github.com/ruby/ruby/pull/12011 |
| Followup: a3f589640fd443deea230c27efd6bdfc92f5817f Restarting scanning has a fixed cost. Since we build a string from many small parts, that causes the scan to restart many times. It's much faster to ignore the coderange, if it's needed later it will be faster to scan it in one go. ``` compare-ruby: ruby 3.4.0dev (2024-09-04T11:54:06Z opt-strftime-growth 149480f0ff) +YJIT [arm64-darwin23] built-ruby: ruby 3.4.0dev (2024-09-04T11:55:26Z opt-strftime-coder.. 29a5153cba) +YJIT [arm64-darwin23] warming up... | |compare-ruby|built-ruby| |:---------------------------|-----------:|---------:| |time.strftime("%FT%T") | 1.870M| 2.225M| | | -| 1.19x| |time.strftime("%FT%T.%3N") | 1.731M| 2.068M| | | -| 1.19x| |time.strftime("%FT%T.%6N") | 1.744M| 2.073M| | | -| 1.19x| ``` Cumulative with a3f589640fd443deea230c27efd6bdfc92f5817f: ``` compare-ruby: ruby 3.4.0dev (2024-09-04T11:55:26Z opt-strftime-coder.. 29a5153cba) +YJIT [arm64-darwin23] built-ruby: ruby 3.4.0dev (2024-09-04T12:57:30Z opt-strftime-coder.. 2b938d667a) +YJIT [arm64-darwin23] warming up... | |compare-ruby|built-ruby| |:---------------------------|-----------:|---------:| |time.strftime("%FT%T") | 1.784M| 2.277M| | | -| 1.28x| |time.strftime("%FT%T.%3N") | 1.504M| 2.056M| | | -| 1.37x| |time.strftime("%FT%T.%6N") | 1.489M| 2.094M| | | -| 1.41x| ``` Notes: Merged: https://github.com/ruby/ruby/pull/11544 |
| [Bug #20593] It's fairly common to use `format` to interpolate a number of values into a user provided strings. The arguments not matching are a problem when they are positional, but when they are named, it's absolutely fine and we shouldn't emit a warning. |
| |
| |
| Notes: Merged: https://github.com/ruby/ruby/pull/6721 |
| Notes: Merged: https://github.com/ruby/ruby/pull/6306 |
| Which restarts scanning the code range in unscanned part. Notes: Merged: https://github.com/ruby/ruby/pull/6306 |
| |
| Notes: Merged: https://github.com/ruby/ruby/pull/6260 |
| Notes: Merged: https://github.com/ruby/ruby/pull/6259 |
| Notes: Merged: https://github.com/ruby/ruby/pull/6258 |
| Notes: Merged: https://github.com/ruby/ruby/pull/6258 |
| Notes: Merged: https://github.com/ruby/ruby/pull/6253 |
| Notes: Merged: https://github.com/ruby/ruby/pull/6253 |
| If we are expanding the string or only stripping extra capacity then coderange won't change, so clearing it is wasteful. Notes: Merged: https://github.com/ruby/ruby/pull/6178 |
| |
| [Misc #18891] Notes: Merged: https://github.com/ruby/ruby/pull/6094 |
| Notes: Merged: https://github.com/ruby/ruby/pull/4783 |
| [Feature #18051] Notes: Merged: https://github.com/ruby/ruby/pull/4763 |
| Notes: Merged: https://github.com/ruby/ruby/pull/4676 |
| Notes: Merged: https://github.com/ruby/ruby/pull/4667 |
| |
| To fix build failures. Notes: Merged: https://github.com/ruby/ruby/pull/3079 |
| This shall fix compile errors. Notes: Merged: https://github.com/ruby/ruby/pull/3079 |
| Split ruby.h Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org> |
| As a temporary lock string is hidden, it can not have instance variables, including non-inlined encoding index. |
| Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies). Notes: Merged: https://github.com/ruby/ruby/pull/2711 |
| This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476 |
| To properly generate documents. |
| to suppress some Coverity Scan warnings |
| * sprintf.c: [DOC] fix typo. Patch by Lazarus Lazaridis (iridakos). [Fix GH-1789] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (ruby__sfvextra): quote symbols as identifiers. * string.c (rb_id_quote_unprintable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (ruby_do_vsnprintf): pathologically, get rid of negative value when the result length exceeds INT_MAX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * error.c: new method KeyError#receiver and KeyError#key. [Feature #12063] * hash.c: make KeyError object with receiver and key. * sprintf.c: ditto. Author: ksss <co000ri@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (ruby_vsnprintf, ruby_snprintf): allow NULL as str, just count the expected buffer size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| ref [Bug #13761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (rb_str_format): explicitly reject too big negative width, instead of an empty string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (rb_str_format): when `t + 1 == end` (or `t < end`), `*t == '%'` is always true. [ruby-core:80153] [Bug #13315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * Add tests and specs. See ruby/spec#401. Patch by Yuta Iwama and Shintaro Morikawa. [ruby-core:80153] [Bug #13315] [Fix GH-1560] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (ruby_ultoa): prefixed to get rid of conflict with a MSVC library function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (rb_str_format, fmt_setup): format by utility functions in vsnprintf.c instead of `snprintf`. * sprintf.c (rb_str_format): format and append by `rb_str_catf` instead of formatting by `snprintf` and then copy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (rb_str_format): `CHECK` just before `FILL_`, but after another `PUSH`. fix one-off bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (rb_str_format): as for non-finite float, calculate the exact needed size with the space flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| * sprintf.c (rb_str_format): while `"% 2f"` and `"% 4f"` result in `" Inf"` and `" Inf"` respectively, `"% 3f"` results in `"Inf"` (no space). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |