64552 Commits

Author SHA1 Message Date
Marc-Andre Lafortune
6b264e833f [ruby/prime] Fix gemspec 2020-12-09 01:30:06 -05:00
Koichi Sasada
45b29754cf need the lock for debug checking.
Checking code (RGENGC_CHECK_MODE > 0) need a VM lock because it
refers objspace.
2020-12-09 15:15:46 +09:00
Marc-Andre Lafortune
47ff8de645 Update maintainers list [doc] [ci skip] 2020-12-09 01:03:29 -05:00
Marc-Andre Lafortune
b603085d2f [ruby/prime] v0.1.2 2020-12-09 00:45:56 -05:00
Marc-Andre Lafortune
1866d483dc [ruby/prime] Optimize Integer#prime?
Miller Rabin algorithm can be used to test primality for integers smaller than a max value "MaxMR" (~3e24)

It can be much faster than previous implementation: ~100x faster for numbers with 13 digits, at least 5 orders of magnitude for even larger numbers (previous implementation is so slow that it requires more patience than I have for more precise estimate).

Miller Rabin test becomes faster than previous implementation at somewhere in the range 1e5-1e6. It seems that the range 62000..66000 is where Miller Rabin starts being always faster, so I picked 0xffff arbitrarily; before that, or above "MaxMR", the previous implementation remains.

I compared the `faster_prime` gem too. It is slower than previous implementation up to ~1e4. After that it becomes faster and faster compared to previous implementation, but is still slower than Miller Rabin starting at ~1e5 and up to MaxMR. Thus, after this commit, builtin `Integer#prime?` will be similar or faster than `faster_prime` up to "MaxMR".

Adapted from patch of Stephen Blackstone [Feature #16468]

Benchmark results and code: https://gist.github.com/marcandre/b263bdae488e76dabdda84daf73733b9

Co-authored-by: Stephen Blackstone <sblackstone@gmail.com>
2020-12-09 00:40:09 -05:00
Nobuyoshi Nakada
dea600046a
Ad-hoc fix of test-bundler 2020-12-09 13:10:28 +09:00
Nobuyoshi Nakada
b419f90a8b
Tweaked Process::Status.wait
* revert `rb_last_status_set`
* renamed the new function as `rb_process_status_new`
* `rb_process_status_new` always freezes the return value
* marked `Process::Status.wait` as EXPERIMENTAL, as it has not
  been discussed totally yet.
2020-12-09 11:51:57 +09:00
Nobuyoshi Nakada
4f907a80f0
Removed declaration of non-existent symbol 2020-12-09 11:32:18 +09:00
Marc-Andre Lafortune
27b6df9653 Add test that Ractor.make_shareable calls user defined #freeze 2020-12-08 17:49:14 -05:00
Samuel Williams
2553c5f94a Add support for non-blocking Process.wait. 2020-12-09 08:55:35 +13:00
git
a4a92ae6d9 * 2020-12-09 [ci skip] 2020-12-09 01:41:06 +09:00
Koichi Sasada
ee194af2aa re-layout rb_ractor_t
separate synchronization data and ractor local data.
2020-12-09 01:40:38 +09:00
Nobuyoshi Nakada
2749123e21
Supported category option in Warning#warn 2020-12-08 22:50:45 +09:00
Nobuyoshi Nakada
d5ffa4e9a4
[DOC] mentioned category option 2020-12-08 22:13:04 +09:00
Kenta Murata
2427393b4d
Revert "test/fiddle/helper.rb: remove duplication (#3863)" (#3865)
This reverts commit bd47a8d660ab33a20c5e28d0effcc29105c434e4.

`libc_so` and `libm_so` are `nil` at line 124 because Big Sur doesn't have `/usr/lib/libSystem.B.dylib`.
The reassignment at line 127 is necessary in this case.
2020-12-08 21:58:08 +09:00
Hiroshi SHIBATA
30d4a7ad9a
Update rubygems.org links for publlished default gems. 2020-12-08 21:42:03 +09:00
Samuel Williams
09229c71bc Fix "Ruby is not properly fortified on armv7hl".
See <https://bugs.ruby-lang.org/issues/16762> for more details.
2020-12-08 23:37:42 +13:00
Hiroshi SHIBATA
aeeaf90b7e
Added missing dependency of fileutils 2020-12-08 18:38:25 +09:00
Nobuyoshi Nakada
d7a16670c3
[DOC] Fixed RDoc directives [ci skip] v3_0_0_preview2 2020-12-08 18:02:31 +09:00
Hiroshi SHIBATA
86332cdce9 Bump version numbers of RubyGems and Bundler on NEWS 2020-12-08 17:30:02 +09:00
Hiroshi SHIBATA
473f9d2df0 Merge prepare version of Bundler 2.2.0 2020-12-08 17:30:02 +09:00
Hiroshi SHIBATA
4aca77edde Merge prepare version of RubyGems 3.2.0 2020-12-08 17:30:02 +09:00
Kazuhiro NISHIYAMA
6a6a24df9b
Fix links [ci skip] 2020-12-08 16:53:25 +09:00
NARUSE, Yui
4b583d4928 Add NEWS about UTF-8 on Windows
* 94b6933d1c6f4c8698319fbcac9dcecc9033b4b9
* ca76337a00244635faa331afd04f4b75161ce6fb
2020-12-08 16:46:14 +09:00
Kazuhiro NISHIYAMA
509241b39f
Add NEWS about Net::SMTP [ci skip] 2020-12-08 16:38:05 +09:00
Kenta Murata
bd47a8d660
test/fiddle/helper.rb: remove duplication (#3863) 2020-12-08 15:42:31 +09:00
Takashi Kokubun
b7dc04e518
Revert some recent JIT changes
Revert "Lock the entire active_units loop"

This reverts commit 5c2ff88be2e515613dfe54823e8429656f688e9f.

Revert "Lock active_units references on compaction"

This reverts commit 556a7285080c1344c75bb93a333c9bfc5d631c61.

Revert "Wait for GC before unload_units"

This reverts commit a8f16df615daa55901bb351efe038e86b61fbb92.

Well, the previous revert actually didn't fix it, but this series of
reverts seems to rollback the situation a little.
2020-12-07 21:12:29 -08:00
Takashi Kokubun
73b07c437e
Revert "Have list_node at the top of rb_mjit_unit"
This reverts commit 3319ce37651aa7e50c31b5fba14871938318b37a.

I still haven't figured out why, but this seems to have increased the
failure rate.
2020-12-07 21:02:26 -08:00
Takashi Kokubun
a8f16df615
Wait for GC before unload_units 2020-12-07 19:57:15 -08:00
Nobuyoshi Nakada
ea18c8bb96
Made method-local instance variables local variables 2020-12-08 11:43:42 +09:00
Takashi Kokubun
5c2ff88be2
Lock the entire active_units loop
The previous fix seems not working. Let me test if this works.
2020-12-07 15:34:02 -08:00
MSP-Greg
41fafd9dd2
Remove BUNLDER_VERSION in Windows (#3859)
[Bug #17372]
2020-12-07 14:47:42 -08:00
Takashi Kokubun
2580093d5d
Pass the flag as $TESTOPTS
Fixing the failure of a4f292426b40f9d6c8f3d646e4b7c667313074f2 like
https://github.com/ruby/ruby/runs/1513663542
2020-12-07 14:21:21 -08:00
Takashi Kokubun
3319ce3765
Have list_node at the top of rb_mjit_unit
to convert list_node to rb_mjit_unit easily in gdb.
2020-12-07 13:54:32 -08:00
NARUSE, Yui
a4f292426b skip failing tests in test-all on mingw
https://bugs.ruby-lang.org/issues/17372
2020-12-08 05:45:22 +09:00
Kenta Murata
146b3695c0
ruby.c: remove needless substitution of uenc
uenc has already been initialized the top of the function.
2020-12-08 02:10:03 +09:00
Kenta Murata
7e69296a2b
memory_view.c: Add rb_memory_view_extract_item_members (#3855) 2020-12-08 02:01:31 +09:00
Lars Kanis
ca76337a00
Windows: Read ENV names and values as UTF-8 encoded Strings (#3818)
* Windows: Read ENV names and values as UTF-8 encoded Strings

Implements issue #12650: fix https://bugs.ruby-lang.org/issues/12650

This also removes the special encoding for ENV['PATH'] and some
complexity in the code that is unnecessary now.

* Windows: Improve readablity of getenv() encoding

getenv() did use the expected codepage as an implicit parameter of the macro.
This is mis-leading since include/ruby/win32.h has a different definition.
Using the "cp" variable explicit (like the other function calls) makes it
more readable and consistent.

* Windows: Change external C-API macros getenv() and execv() to use UTF-8

They used to process and return strings with locale encoding,
but since all ruby-internal spawn and environment functions use UTF-8,
it makes sense to change the C-API equally.
2020-12-08 02:00:39 +09:00
Lars Kanis
94b6933d1c
Set default for Encoding.default_external to UTF-8 on Windows (#2877)
* Use UTF-8 as default for Encoding.default_external on Windows
* Document UTF-8 change on Windows to Encoding.default_external

fix https://bugs.ruby-lang.org/issues/16604
2020-12-08 01:48:37 +09:00
aycabta
3bf7b999e5 [ruby/reline] Editing to initial content is not just cursor moving
https://github.com/ruby/reline/commit/0a4f175b0a
2020-12-08 00:08:41 +09:00
git
b5ef4ad312 * 2020-12-08 [ci skip] 2020-12-08 00:01:43 +09:00
Nobuyoshi Nakada
05e1d87e62
rbinstall.rb: do not install useless files after installed 2020-12-07 23:57:31 +09:00
Nobuyoshi Nakada
91f831ac17
Extract gemspec to versioned file
Not to be overwritten by test-bundler-prepare.  gem files often
contain useless gemspec files which have not been processed.
2020-12-07 23:47:37 +09:00
Nobuyoshi Nakada
e025113d71
rbinstall.rb: relaxed split argument
did_you_mean splits the output by `$/`.
2020-12-07 22:40:46 +09:00
Nobuyoshi Nakada
5894ea5954
rbinstall.rb: fix the position to expand files
As `spec.files` is used for `executables` and so on, the expanded
list needs to be located at the same place.
2020-12-07 22:38:09 +09:00
Masaki Matsushita
c6b37cb169 Remove resolv_timeout of TCPSocket.new from NEWS
We couldn't support it for now, because getaddrinfo_a(3)
was reverted in 5d8bcc4870. `resolv_timeout` will be just ignored.
2020-12-07 21:37:33 +09:00
Nobuyoshi Nakada
29dee10af2
rbinstall.rb: install files expanded from bundled gems
Although gemspec file (e.g., power_assert and rake) often uses
`git ls-files`, as it does not make sense in other than its own
repository, it has been ignored now.  Gather all files expanded
from the bundled gem to install, instead.
2020-12-07 19:09:23 +09:00
Nobuyoshi Nakada
7817a438eb Removed deprecated Time#succ 2020-12-07 18:38:59 +09:00
Nobuyoshi Nakada
20d53dad47
Update the version guard to 3.0 2020-12-07 18:35:59 +09:00
卜部昌平
547c71dec4
Hash#index: delete
Has been deprecated since 0c97c8e33584e6203bb09c08f92b63bd2cca8ae7.
2020-12-07 18:35:58 +09:00