summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-03[ruby/reline] Add newlines for readabilityaycabta
https://github.com/ruby/reline/commit/2a60aacebb
2021-10-03[ruby/reline] Use String#unpack1aycabta
https://github.com/ruby/reline/commit/179c52bca8
2021-10-03[ruby/reline] Adjust border of scrollbar rendering calculationaycabta
https://github.com/ruby/reline/commit/737b23beae
2021-10-03[ruby/reline] The @block_elem_width shouldn't be used for height calculationaycabta
https://github.com/ruby/reline/commit/da35902d78
2021-10-03[ruby/reline] Stop using Ctrl+j to test on Windowsaycabta
Because Ctrl+j and Enter are the same on Windows. https://github.com/ruby/reline/commit/fa885ed449
2021-10-03Cast to void pointer to suppress -Wformat-pedantic in RUBY_DEBUG_LOGNobuyoshi Nakada
2021-10-02Avoid using the altzone variable in AIXRei Odaira
In AIX, altzone exists in the standard library but is not declared in time.h. By 524513be399e81bb170ec88aa0d501f33cbde8c3, have_var and try_var in mkmf recognizes a variable that exists in a library even when it is not declared. As a result, in AIX, HAVE_ALTZONE is defined, but compile fails due to the lack of the declaration.
2021-10-03[DOC] fix small mistake in doc/marshal.rdoc [ci skip]mitsu-ksgr
Notes: Merged: https://github.com/ruby/ruby/pull/4466 Merged-By: nobu <nobu@ruby-lang.org>
2021-10-03Get rid of unused function warning for `_WIN32`xtkoba
Notes: Merged: https://github.com/ruby/ruby/pull/4482
2021-10-03* 2021-10-03 [ci skip]git
2021-10-02Temporarily skip test_no_curdir test to avoid CI failures on SolarisJeremy Evans
2021-10-02Do not load file with same realpath twice when requiringJeremy Evans
This fixes issues with paths being loaded twice in certain cases when symlinks are used. It took me multiple attempts to get this working. My original attempt tried to convert paths to realpaths before adding them to $LOADED_FEATURES. Unfortunately, this doesn't work well with the loaded feature index, which is based off load paths and not realpaths. While I was able to get require working, I'm fairly sure the loaded feature index was not being used as expected, which would have significant performance implications. Additionally, I was never able to get that approach working with autoload when autoloading a non-realpath file. It also broke some specs. This takes a more conservative approach. Directly before loading the file, if the file with the same realpath has been required, the loading of the file is skipped. The realpaths are stored as fstrings in a hidden hash. When rebuilding the loaded feature index, the hash of realpaths is also rebuilt. I'm guessing this makes rebuilding process slower, but I don think that is a hot path. In general, modifying loaded features is only done when reloading, and that tends to be in non-production environments. Change test_require_with_loaded_features_pop test to use 30 threads and 300 iterations, instead of 4 threads and 1000 iterations. I saw only sporadic failures with 4/1000, but consistent failures 30/300 threads. These failures were due to the fact that the concurrent deletions from $LOADED_FEATURES in other threads can result in rb_ary_entry returning nil when rebuilding the loaded features index. To avoid concurrency issues when rebuilding the loaded features index, the building of the index itself is left alone, and afterwards, a separate loop is done on a copy of the loaded feature snapshot in order to rebuild the realpaths hash. Fixes [Bug #17885] Notes: Merged: https://github.com/ruby/ruby/pull/4887
2021-10-02Make encoding loading not issue warningJeremy Evans
Instead of relying on setting an unsetting ruby_verbose, which is not thread-safe, restructure require_internal and load_lock to accept a warn argument for whether to warn, and add rb_require_internal_silent to require without warnings. Use rb_require_internal_silent when loading encoding. Note this does not modify ruby_debug and errinfo handling, those remain thread-unsafe. Also silent requires when loading transcoders. Notes: Merged: https://github.com/ruby/ruby/pull/4887
2021-10-02[Win32] Prefer Cryptography Next Generation APINobuyoshi Nakada
[BCryptGenRandom] is available since Windows Vista / Windows Server 2008. Regarding [CryptGenRandom]: > This API is deprecated. New and existing software should start > using Cryptography Next Generation APIs. Microsoft may remove > this API in future releases. [BCryptGenRandom]: https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom [CryptGenRandom]: https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom Notes: Merged: https://github.com/ruby/ruby/pull/4924
2021-10-02[ruby/reline] Refactoring Reline::Key.match? and add test.manga_osyo
https://github.com/ruby/reline/commit/90e8999ae4
2021-10-01Avoid race condition in Regexp#matchJeremy Evans
In certain conditions, Regexp#match could return a MatchData with missing captures. This seems to require at the least, multiple threads calling a method that calls the same block/proc/lambda which calls Regexp#match. The race condition happens because the MatchData is passed from indirectly via the backref, and other threads can modify the backref. Fix the issue by: 1. Not reusing the existing MatchData from the backref, and always allocating a new MatchData. 2. Passing the MatchData directly to the caller using a VALUE*, instead of indirectly through the backref. It's likely that variants of this issue exist for other Regexp methods. Anywhere that MatchData is passed implicitly through the backref is probably vulnerable to this issue. Fixes [Bug #17507] Notes: Merged: https://github.com/ruby/ruby/pull/4734
2021-10-02Restore Hash#compare_by_identity mode [Bug #18171]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4893
2021-10-02Add rb_ident_hash_new_with_sizeNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4893
2021-10-02Suppress maybe-uninitialized warning on mingwNobuyoshi Nakada
The compilation time pragma seems not applied to inline functions expanded by the link time optimization. The local variable `mi` in thread_win32.c:native_thread_init_stack is warned.
2021-10-01Enhanced RDoc for Enumerable (#4922)Burdette Lamar
Treated: #drop #drop_while #cycle Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-01Enhanced RDoc for Enumerable (#4918)Burdette Lamar
Treats: #zip #take #take_while Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-02* 2021-10-02 [ci skip]git
2021-10-01Fix typo in static function nameJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/4919
2021-10-01Introduce rb_vm_call_with_refinements to DRY up a few callsJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/4919
2021-10-01Checks for CPU specific header on universal buildNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4921
2021-10-01Prefer `printf` like the recent autoconfNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4921
2021-10-01Associate the encoding to the found pathNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4915
2021-10-01Skip broken strings as the locale encodingNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4915
2021-10-01Replace expanded load path only when modifiedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4915
2021-10-01Copy path strings as interned stringsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4915
2021-10-01Fix the encoding of loaded feature names [Bug #18191]Nobuyoshi Nakada
The feature names loaded from the default load paths should also be in the file system encoding. Notes: Merged: https://github.com/ruby/ruby/pull/4915
2021-10-01Use macos-11 instead of macos-latestKazuhiro NISHIYAMA
Notes: Merged: https://github.com/ruby/ruby/pull/4920
2021-10-01Use macos-10.15 and macos-11 instead of macos-latestKazuhiro NISHIYAMA
https://github.blog/changelog/2021-09-29-github-actions-jobs-running-on-macos-latest-are-now-running-on-macos-big-sur-11/ Notes: Merged: https://github.com/ruby/ruby/pull/4920
2021-10-01Define ACTION-IF-UNIVERSAL of `AC_C_BIGENDIAN` [Bug #18156]Nobuyoshi Nakada
As we do not use config.h.in, just define the helper macro instead.
2021-09-30Make Array#min/max optimization respect refined methodsJeremy Evans
Pass in ec to vm_opt_newarray_{max,min}. Avoids having to call GET_EC inside the functions, for better performance. While here, add a test for Array#min/max being redefined to test_optimization.rb. Fixes [Bug #18180] Notes: Merged: https://github.com/ruby/ruby/pull/4911 Merged-By: jeremyevans <code@jeremyevans.net>
2021-09-30Enhanced RDoc for Enumerable (#4917)Burdette Lamar
Treats: #each_with_index #reverse_each #each_entry #each_slice #each_cons #each_with_object Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-01* 2021-10-01 [ci skip]git
2021-09-30Use faster any_hash logic in rb_hashJohn Hawthorn
From the documentation of rb_obj_hash: > Certain core classes such as Integer use built-in hash calculations and > do not call the #hash method when used as a hash key. So if you override, say, Integer#hash it won't be used from rb_hash_aref and similar. This avoids method lookups in many common cases. This commit uses the same optimization in rb_hash, a method used internally and in the C API to get the hash value of an object. Usually this is used to build the hash of an object based on its elements. Previously it would always do a method lookup for 'hash'. This is primarily intended to speed up hashing of Arrays and Hashes, which call rb_hash for each element. compare-ruby: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux] built-ruby: ruby 3.1.0dev (2021-09-29T02:13:24Z fast_hash d670bf88b2) [x86_64-linux] # Iteration per second (i/s) | |compare-ruby|built-ruby| |:----------------|-----------:|---------:| |hash_aref_array | 1.008| 1.769| | | -| 1.76x| Notes: Merged: https://github.com/ruby/ruby/pull/4916
2021-09-30marshal.c: don't call the proc with partially initialized objects. (#4866)Jean byroot Boussier
For cyclic objects, it requires to keep a st_table of the partially initialized objects. Notes: Merged-By: byroot <jean.boussier@gmail.com>
2021-09-30Needs `AC_PROG_CC`Nobuyoshi Nakada
Although `AC_PROG_CC_C99` has been obsolete, `AC_PROG_CC` is not and the latter is necessary not to make C++ compiler mandatory. Notes: Merged: https://github.com/ruby/ruby/pull/4914
2021-09-30rb_fiber_raise(): add doxygen卜部昌平
Must not be a bad idea to improve documents. Notes: Merged: https://github.com/ruby/ruby/pull/4912
2021-09-30* 2021-09-30 [ci skip]git
2021-09-29Enhanced RDoc for Enumerable (#4910)Burdette Lamar
Treats: #min #max #minmax #min_by #max_by #minmax_by #include? Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-29lldb: Get rid of error at unpreserved encodings [ci skip]Nobuyoshi Nakada
2021-09-29[ruby/reline] Support ed_argument_digit by M+numaycabta
The vi mode can handle "argument number" before an operator or a motion, such as, "3x" (equals "xxx"), and "3l" (equals "lll"). In the emacs mode, GNU Readline can handle argument number with meta key, like "Meta+3 x" (equals "xxx"). https://github.com/ruby/reline/commit/9183cc2e8b
2021-09-28Enhanced RDoc for Enumerable (#4908)Burdette Lamar
Treated: #none? #one? #min Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-29Refactor rb_add_event_hook functionS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/4907
2021-09-29* 2021-09-29 [ci skip]git
2021-09-28Enhanced RDoc for Enumerable (#4906)Burdette Lamar
Treats: #partition #group_by #tally #first #sort #sort_by #all? #any? Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-28lldb: Show encoding of String [ci skip]Nobuyoshi Nakada