Граф коммитов

8217 Коммитов

Автор SHA1 Сообщение Дата
Kazuki Yamaguchi 67f5847c61 [ruby/openssl] config: remove deprecated methods
Remove 4 deprecated methods.

The following two methods have been marked as deprecated since 2003,
by r4531 (ruby.git commit 78ff3833fb).

 - OpenSSL::Config#value
 - OpenSSL::Config#section

Other two methods are removed because the corresponding functions
disappeared in OpenSSL 1.1.0.

 - OpenSSL::Config#add_value
 - OpenSSL::Config#[]=

https://github.com/ruby/openssl/commit/9783d7f21c
2021-03-16 19:16:10 +09:00
Spencer McIntyre 4d8bce227c [ruby/openssl] Define Cipher #ccm_data_len= for CCM mode ciphers
Allow specifying just length to #update

CCM mode ciphers need to specify the total plaintext or ciphertext
length to EVP_CipherUpdate.

Update the link to the tests file

Define Cipher#ccm_data_len= for CCM mode ciphers

Add a unit test for CCM mode

Also check CCM is authenticated when testing

https://github.com/ruby/openssl/commit/bb3816953b
2021-03-16 19:16:10 +09:00
wanabe 0c5f8c6276 [ruby/zlib] Resume zstream if available [Bug #10961] 2021-03-09 13:19:03 +09:00
Nobuyoshi Nakada 32a13591e0
[ruby/stringio] Check if closed in loop
[Bug #17675] https://bugs.ruby-lang.org/issues/17675

https://github.com/ruby/stringio/commit/1ed61d0cbc
2021-03-08 10:13:29 +09:00
Hiroshi SHIBATA 99f54c0895
[ruby/stringio] Use Gemfile instead of Gem::Specification#add_development_dependency.
https://github.com/ruby/stringio/commit/157fe9f04d
2021-03-08 10:12:57 +09:00
Nobuyoshi Nakada f6d5de8f33 [ruby/io-wait] Declare as Ractor-safe
Fixes https://bugs.ruby-lang.org/issues/17659

https://github.com/ruby/io-wait/commit/ba338b4764
2021-03-07 09:54:35 +09:00
Nobuyoshi Nakada ea81fff564 [ruby/io-wait] bump up to 0.1.1
https://github.com/ruby/io-wait/commit/88db082d60
2021-03-07 09:54:35 +09:00
Nobuyoshi Nakada 05d118feea [ruby/io-wait] Fixed required_ruby_version
Before 3.0.0, io-wait has not been gemified.

https://github.com/ruby/io-wait/commit/6fed3da323
2021-03-07 09:54:35 +09:00
Nobuyoshi Nakada 3ba1580d80 [ruby/io-wait] Revise IO#wait arguments
https://github.com/ruby/io-wait/commit/0599f6d4d6
https://github.com/ruby/io-wait/commit/4e982aea1b
https://github.com/ruby/io-wait/commit/5b45685eb3
2021-03-07 09:54:35 +09:00
Aaron Patterson d45466dc5b
Oops! Add another test and fix to_proc implementation 2021-02-26 10:06:56 -08:00
Aaron Patterson 0590e9b677
Fiddle::Function responds to to_proc
This lets us cast a Fiddle::Function to a block, allowing is to write
things like:

```ruby
f = Fiddle::Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP)
define_method :strcpy, &f
```
2021-02-26 09:57:13 -08:00
Shugo Maeda 5de38c41ae
ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug #17644] 2021-02-19 16:40:29 +09:00
Nobuyoshi Nakada 9a5da2dcff [ruby/readline-ext] Initialize libedit before managing the history
Fixes https://bugs.ruby-lang.org/issues/17629

https://github.com/ruby/readline-ext/commit/250d6787ed
2021-02-18 21:18:37 +09:00
Jeremy Evans c03b723f56 Update class documentation for StringScanner
The [] wasn't being displayed, and try to fix formatting for bol?
and << (even if they aren't linked).

Fixes [Bug #17620]
2021-02-10 08:17:07 -08:00
Hiroshi SHIBATA e72757a311 [ruby/zlib] Don't use gemspec for gem dependecy
https://github.com/ruby/zlib/commit/7d3d19710f
2021-02-10 12:49:33 +09:00
Nobuyoshi Nakada 6bb103f012
[ruby/console] Updated depend 2021-02-09 17:49:28 +09:00
Nobuyoshi Nakada 5bfca88f76
[ruby/io-console] Fixed typo 2021-02-09 17:39:00 +09:00
Nobuyoshi Nakada df4f8aa248
[ruby/io-console] Fixed regression against 3.0 2021-02-09 17:38:52 +09:00
Samuel Williams 5f69a7f604
Expose scheduler as public interface & bug fixes. (#3945)
* Rename `rb_scheduler` to `rb_fiber_scheduler`.

* Use public interface if available.

* Use `rb_check_funcall` where possible.

* Don't use `unblock` unless the fiber was non-blocking.
2021-02-09 19:39:56 +13:00
Nobuyoshi Nakada 4186cd6435
Revert a part of "[DOC] refined" [ci skip]
This reverts commit 478716f49a
partially -- "Removed unnecessary parentheses" part -- because of
a lambda, see 9e25eb308d.
2021-02-08 21:46:07 +09:00
Nobuyoshi Nakada 478716f49a
[DOC] refined
* Adjusted indentation in license section, and used "(c)"
* Commented out invalid syntax to enable highlighting
* Removed unnecessary parentheses
2021-02-07 21:24:44 +09:00
Jean Boussier 3a888398a6 objspace_dump.c: tag singleton classes and reference the superclass 2021-02-04 09:53:31 -08:00
Dimitris Zorbas 46b5b51cc6 [DOC] Fix typo in ext/socket/socket.c [ci skip] 2021-02-04 13:29:58 +09:00
Kenta Murata 4e2e1d6093
[ruby/bigdecimal] Fix uint64 conversion
Stop using logarithm to compute the number of components.
Instead, use the theoretical maximum number of components for buffer,
and count up the actual number of components during conversion.

https://github.com/ruby/bigdecimal/commit/9067b353ac
2021-02-04 13:18:58 +09:00
Kenta Murata 868d66e0b5
[ruby/bigdecimal] Stop using rmpd and RMPD prefixes and DBLE_FIG
https://github.com/ruby/bigdecimal/commit/7479923fdb
2021-02-04 13:18:52 +09:00
Kenta Murata 8df1881c8f [ruby/bigdecimal] Fix the maximum length of float number
This change is for preventing the false-positive alert by CoverityScan.
See CID-1471770 for the detail.

https://github.com/ruby/bigdecimal/commit/4d5b97125b
2021-02-03 18:25:03 +09:00
Aaron Patterson 8ef30bcc04
Fix GC compatibility: Don't stash encodings in global constants
This value should either be pinned, or looked up when needed at runtime.
Without pinning, the GC may move the encoding object, and that could
cause a crash.

In this case it is easier to find the value at runtime, and there is no
performance penalty (as Ruby caches encoding indexes).  We can shorten
the code, be compaction friendly, and incur no performance penalty.
2021-02-01 12:20:34 -08:00
Nobuyoshi Nakada 9241211538 Forward keyword arguments for Pathname#each_line [Bug #17589] 2021-01-29 14:27:53 +09:00
Kenta Murata a1bb110b56 [ruby/bigdecimal] [Doc] Fix the comment of BigDecimal_div2 [ci skip]
https://github.com/ruby/bigdecimal/commit/a109d0984f
2021-01-22 14:07:32 +09:00
Kenta Murata 887a1bfbbc [ruby/bigdecimal] Stop using GetVpValue in rb_big_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/034fd2b25e
2021-01-22 13:59:04 +09:00
Jean Boussier 6ca3d1af33 objspace_dump.c: Handle allocation path and line missing 2021-01-20 10:48:13 -08:00
manga_osyo b84b253a69 Fix Ripper with heredoc. 2021-01-17 12:58:13 +09:00
Nobuyoshi Nakada 35a047301b
[ruby/io-console] Rubygems 3.2 supports `--platform` option
https://github.com/ruby/io-console/commit/c8046fde84
2021-01-16 19:42:53 +09:00
Nobuyoshi Nakada 6ab5504fe5
[ruby/io-console] Moved JRuby version files into particular path
https://github.com/ruby/io-console/commit/b0691d2c20
2021-01-16 19:42:52 +09:00
Nobuyoshi Nakada 92da224d22
[ruby/io-console] Delegate to JRuby version
Add `--platform` option tentatively.

https://github.com/ruby/io-console/commit/3bf1a7b753
2021-01-16 19:42:52 +09:00
Nobuyoshi Nakada c143a2f947
[ruby/io-console] bump up to 0.5.7
https://github.com/ruby/io-console/commit/f55d7ebff6
2021-01-16 19:42:52 +09:00
Kenta Murata b130644584 [ruby/bigdecimal] Fix for the coerce cases in divide and DoDivmod
https://github.com/ruby/bigdecimal/commit/1cb92487f7
2021-01-16 00:09:26 +09:00
Kenta Murata 9d0c5e2754 [ruby/bigdecimal] Use pre-allocated special values in BigDecimal_DoDivmod
https://github.com/ruby/bigdecimal/commit/d2746121cf
2021-01-16 00:08:09 +09:00
Kenta Murata f95f85b215 [ruby/bigdecimal] Use new conversion functions in BigDecimal_DoDivmod
https://github.com/ruby/bigdecimal/commit/68c20200d5
2021-01-16 00:07:48 +09:00
Kenta Murata 0a039c5fbb [ruby/bigdecimal] Use new conversion functions in BigDecimal_divide
https://github.com/ruby/bigdecimal/commit/3b55ad1c42
2021-01-15 06:42:48 +09:00
Kenta Murata 500fc63cd0 [ruby/bigdecimal] Reorder the arguments of BigDecimal_divide
https://github.com/ruby/bigdecimal/commit/1e03da7076
2021-01-15 06:42:38 +09:00
Kenta Murata 4d13f3e9da [ruby/bigdecimal] Explicitly cast size_t to int
https://github.com/ruby/bigdecimal/commit/b1f1ed26c9
2021-01-14 10:21:10 +09:00
Kenta Murata b4ade73974
[ruby/bigdecimal] Explicitly cast uint64_t to double
https://github.com/ruby/bigdecimal/commit/f0d94e6843
2021-01-14 10:20:47 +09:00
Kenta Murata e129be7592 [ruby/bigdecimal] Suppress warning at NO_SANITIZE on gcc
https://github.com/ruby/bigdecimal/commit/f6765b8071
2021-01-14 10:20:30 +09:00
Nobuyoshi Nakada 521ad9a13a Moved Fiber methods into core [Feature #17407] 2021-01-13 23:20:02 +09:00
Kenta Murata a5b4b806de
[ruby/bigdecimal] Allow digits=0 in BigDecimal(flt) and Float#to_d
Using dtoa of mode=0, we can determine the number of digits in decimal that is
necessary to represent the given Float number without errors.

This change permits digits=0 in BigDecimal(flt) and Float#to_d, and these
methods use dtoa of mode=0 when the given digits is 0.

Internal implicit conversion from Float also uses digits=0.

[Fix GH-70]

https://github.com/ruby/bigdecimal/commit/2dbe170e35
2021-01-13 11:49:18 +09:00
Kenta Murata 0a4f719a06
Update ext/bigdecimal/depend 2021-01-13 09:36:17 +09:00
Kenta Murata 28321e400e
Update ext/bigdecimal/depend 2021-01-13 09:08:48 +09:00
Kenta Murata 4ba3a4491e
[ruby/bigdecimal] Optimize rb_float_convert_to_BigDecimal by using dtoa
This improve the conversion speed several times faster than before.

```
RUBYLIB= BUNDLER_ORIG_RUBYLIB= /home/mrkn/.rbenv/versions/3.0.0/bin/ruby -v -S benchmark-driver /home/mrkn/src/github.com/ruby/bigdecimal/benchmark/from_float.yml
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
Calculating -------------------------------------
                     bigdecimal 3.0.0      master
              flt_e0         156.400k    783.356k i/s -    100.000k times in 0.639388s 0.127656s
            flt_ep10         158.640k    777.978k i/s -    100.000k times in 0.630359s 0.128538s
           flt_ep100         101.676k    504.259k i/s -    100.000k times in 0.983512s 0.198311s
            flt_em10         103.439k    726.339k i/s -    100.000k times in 0.966751s 0.137677s
           flt_em100          79.675k    651.446k i/s -    100.000k times in 1.255095s 0.153505s

Comparison:
                           flt_e0
              master:    783355.6 i/s
    bigdecimal 3.0.0:    156399.5 i/s - 5.01x  slower

                         flt_ep10
              master:    777977.6 i/s
    bigdecimal 3.0.0:    158639.7 i/s - 4.90x  slower

                        flt_ep100
              master:    504259.4 i/s
    bigdecimal 3.0.0:    101676.5 i/s - 4.96x  slower

                         flt_em10
              master:    726338.6 i/s
    bigdecimal 3.0.0:    103439.2 i/s - 7.02x  slower

                        flt_em100
              master:    651446.3 i/s
    bigdecimal 3.0.0:     79675.3 i/s - 8.18x  slower

```

https://github.com/ruby/bigdecimal/commit/5bdaedd530
https://github.com/ruby/bigdecimal/commit/9bfff57f90
https://github.com/ruby/bigdecimal/commit/d071a0abbb
2021-01-13 02:11:18 +09:00
Kenta Murata 2175c2c957 [ruby/bigdecimal] Use pre-allocated objects for special values
https://github.com/ruby/bigdecimal/commit/95c201f2d3
2021-01-13 01:58:23 +09:00
Kenta Murata 6670de82c2
[ruby/bigdecimal] Fix exception message raised in Kernel.BigDecimal
https://github.com/ruby/bigdecimal/commit/d163f170a4
https://github.com/ruby/bigdecimal/commit/ff8eeeb064
2021-01-13 01:27:04 +09:00
Kenta Murata ccabf4966f [ruby/bigdecimal] Fix length calculation in rb_uint64_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/14e53ed7f6
2021-01-12 17:38:43 +09:00
Kenta Murata 1d04faee23 [ruby/bigdecimal] Use rb_cstr_convert_to_BigDecimal in GetVpValueWithPrec
https://github.com/ruby/bigdecimal/commit/381ddf5ff6
2021-01-12 09:22:14 +09:00
Kenta Murata 78d3813c74 [ruby/bigdecimal] Add rb_cstr_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/ac230a996e
2021-01-12 09:21:58 +09:00
Nobuyoshi Nakada d2aaf865e3 [ruby/etc] Added fallback definition of RUBY_ATOMIC_EXCHANGE
https://github.com/ruby/etc/commit/0c5900bd21
2021-01-11 11:39:12 +09:00
Nobuyoshi Nakada f6e2c41db3 [ruby/etc] Check blocking variables at release
https://github.com/ruby/etc/commit/f017bdfedf
2021-01-11 11:39:10 +09:00
Kenta Murata 2e9b6096a6 [ruby/bigdecimal] Fix type name
https://github.com/ruby/bigdecimal/commit/2dad4d17b2
2021-01-10 08:40:05 +09:00
Kenta Murata 8b53cbaf5e
[ruby/bigdecimal] Avoid casting negative value to size_t
https://github.com/ruby/bigdecimal/f047b2786f
2021-01-10 08:36:29 +09:00
Kenta Murata 72d504c1fd
[ruby/bigdecimal] Use smallest local variable scope in GetVpValueWithPrec
https://github.com/ruby/bigdecimal/commit/44f26b9aa0
2021-01-10 08:35:43 +09:00
Nobuyoshi Nakada 590dc06e38 Get rid of defining methods for tests in core classes
Not to interfere in other tests.
2021-01-09 22:38:06 +09:00
Kenta Murata 3d9c95996d
[ruby/bigdecimal] Stop using GetVpValueWithPrec in rb_rational_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/b4f470da61
https://github.com/ruby/bigdecimal/commit/44a78df866
2021-01-09 20:36:47 +09:00
Kenta Murata be34e31d8e [ruby/bigdecimal] Add assertions for checking the argument types
https://github.com/ruby/bigdecimal/commit/96c9ebd886
2021-01-09 20:36:18 +09:00
Kenta Murata fb18a8113a
[ruby/bigdecimal] Stop using GetVpValueWithPrec in rb_float_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/33e7c50263
https://github.com/ruby/bigdecimal/commit/d3c1b0b921
2021-01-09 20:35:52 +09:00
Kenta Murata 82f6085b3e [ruby/bigdecimal] Fix trailing zero handling in rb_uint64_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/2056604d56
2021-01-07 10:20:40 +09:00
Kenta Murata fa8295ccb9
[ruby/bigdecimal] Rename BDIGIT to DECDIG
https://github.com/ruby/bigdecimal/commit/686487d942
2021-01-06 13:52:12 +09:00
Kenta Murata 7da06c04b2
Need to convert the return value of rb_big_cmp 2021-01-06 13:39:09 +09:00
Kenta Murata f289f8ae3a [ruby/bigdecimal] Optimize the conversion from small Bignum
https://github.com/ruby/bigdecimal/commit/4792a917d8
2021-01-06 10:56:48 +09:00
Kenta Murata 31854403b3
[ruby/bigdecimal] Check the function availabilities separately
https://github.com/ruby/bigdecimal/commit/cf839a34c8
https://github.com/ruby/bigdecimal/commit/75db4dabb9
2021-01-06 09:25:13 +09:00
Marcus Stollsteimer 3108ad7bf3 [DOC] Fix grammar: "is same as" -> "is the same as" 2021-01-05 15:13:53 +01:00
Kazuhiro NISHIYAMA 3d43944725
Fix a typo [ci skip] 2021-01-05 23:10:39 +09:00
Nobuyoshi Nakada 83e62d7798 [ruby/io-console] Shrink struct query_args
https://github.com/ruby/io-console/commit/720be0a3e5
2021-01-05 21:26:15 +09:00
Nobuyoshi Nakada 4272395982 [ruby/io-console] Pre-define chomp! ID
https://github.com/ruby/io-console/commit/028e1c9497
2021-01-05 21:26:13 +09:00
Nobuyoshi Nakada ead8d89bd7 [ruby/io-console] Ignore chomp! result and return the modified string
https://github.com/ruby/io-console/commit/09e5ccc729
2021-01-05 21:26:11 +09:00
Marcus Stollsteimer 451b456051 [ruby/io-console] [DOC] Note that IO#getpass returns a chomped string
IO#getpass uses String#chomp! on the read input line.

https://github.com/ruby/io-console/commit/1e98c93bc8
2021-01-05 12:59:53 +09:00
Koichi Sasada e7fc353f04 enable constant cache on ractors
constant cache `IC` is accessed by non-atomic manner and there are
thread-safety issues, so Ruby 3.0 disables to use const cache on
non-main ractors.

This patch enables it by introducing `imemo_constcache` and allocates
it by every re-fill of const cache like `imemo_callcache`.
[Bug #17510]

Now `IC` only has one entry `IC::entry` and it points to
`iseq_inline_constant_cache_entry`, managed by T_IMEMO object.

`IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and
`rb_mjit_after_vm_ic_update()` is not needed.
2021-01-05 02:27:58 +09:00
Nobuyoshi Nakada 433a3be86a
ripper: call #pretty_print on also `state` 2021-01-04 23:37:00 +09:00
Kenta Murata 4b90ea8480
Update ext/bigdecimal/depend 2021-01-04 13:42:10 +09:00
Kenta Murata 71f0dd339b
[ruby/bigdecimal] Move some definitions to missing.h
https://github.com/ruby/bigdecimal/commit/c2b22cc8b3
https://github.com/ruby/bigdecimal/commit/8cbca8481d
https://github.com/ruby/bigdecimal/commit/f05aecf673
2021-01-04 13:29:10 +09:00
Kenta Murata 597e063606
Revert "Include RUBY_EXTCONF_H if available"
It is unnecessary because RUBY_EXTCONF_H has already been included in
ruby/internal/config.h.

This reverts commit 0644f466b0.
2021-01-04 12:01:04 +09:00
Kenta Murata 0644f466b0
Include RUBY_EXTCONF_H if available 2021-01-03 23:38:21 +09:00
Kenta Murata a6bbba1135
Avoid to use __builtin_clzl in SPARC Solaris 2021-01-02 12:06:14 +09:00
Kenta Murata ef6ab776d5
Add __x86_64__ guard to include x86intrin.h 2021-01-02 10:18:58 +09:00
Nobuyoshi Nakada 5aa28d9d6d
Check if x86intrin.h is available not only existing 2021-01-02 09:48:42 +09:00
Kenta Murata 830afd94fe
[ruby/bigdecimal] Update depend 2021-01-02 01:03:32 +09:00
Kenta Murata c2c0147538
[ruby/bigdecimal] Fix test for Ruby 2.4
Ruby 2.4 does not have RbConfig::LIMITS.

https://github.com/ruby/bigdecimal/commit/c8087523b0
2021-01-02 00:54:09 +09:00
Kenta Murata 448a67cd81
[ruby/bigdecimal] Implement special conversions for 64-bit integers
This change improves the conversion speed from small integers.

```
Comparison:
                           big_n9
              master:   4003688.9 i/s
    bigdecimal 3.0.0:   1270551.0 i/s - 3.15x  slower

                          big_n19
              master:   5410096.4 i/s
    bigdecimal 3.0.0:   1000250.3 i/s - 5.41x  slower
```

https://github.com/ruby/bigdecimal/commit/3429bd7e6f
2021-01-02 00:54:09 +09:00
Kenta Murata a8014dae47 [ruby/bigdecimal] Refactor object allocation
https://github.com/ruby/bigdecimal/commit/271cebe567
2020-12-31 02:05:02 +09:00
Kenta Murata 4569e46550 [ruby/bigdecimal] Remove ToValue
https://github.com/ruby/bigdecimal/commit/97e9feeebd
2020-12-31 02:04:53 +09:00
Kenta Murata 8d93c1e70f [ruby/bigdecimal] Remove VP_EXCEPTION_MEMORY
It is no longer used due to the previous commit.

https://github.com/ruby/bigdecimal/commit/7d463f802b
2020-12-30 00:22:21 +09:00
Kenta Murata 086f3f1872 [ruby/bigdecimal] Remove needless pointer checks
xmalloc and xrealloc return non-NULL pointers or raise memory error.

https://github.com/ruby/bigdecimal/commit/507f0a6a64
2020-12-30 00:22:11 +09:00
Kenta Murata 47a1f5ff73
[ruby/bigdecimal] Define bool, true, and false for old Ruby
https://github.com/ruby/bigdecimal/commit/a6d3bd2d44
2020-12-29 17:46:37 +09:00
Kenta Murata 29d012c964
[ruby/bigdecimal] Alloc wrapper object before VpAlloc
Calling TypedData_Wrap_Struct after VpAlloc may cause memory leak.

This commit reverts d11b78f9c4.

https://github.com/ruby/bigdecimal/commit/2c5a288caf
2020-12-29 17:46:36 +09:00
Kenta Murata 13b520d578
[ruby/bigdecimal] Refactor to extract VpCheckException
https://github.com/ruby/bigdecimal/commit/6fd171308b
2020-12-29 17:46:36 +09:00
Nobuyoshi Nakada d57c5a7b61 transcode-tblgen.rb: make silent a little when just -v 2020-12-29 17:45:19 +09:00
Masaki Matsushita 1ffb267c5c Fix compile error of sockssocket
The patch is provided by PhobosK (Phobos Kappa).

This should be backported to Ruby 3.0.

[Feature #17187]
2020-12-29 15:52:42 +09:00
Kenta Murata 512e08895f [ruby/bigdecimal] Refactor to decompose VpNewVarArg into small functions
https://github.com/ruby/bigdecimal/commit/7504871c48
2020-12-29 12:56:10 +09:00
Kenta Murata d11b78f9c4 [ruby/bigdecimal] Reduce needless object allocation in f_BigDecimal
https://github.com/ruby/bigdecimal/commit/5c808eeabb
2020-12-29 12:54:39 +09:00
Kenta Murata 06b44f819e [ruby/bigdecimal] [Doc] Fix the document of BigDecimal()
[ci-skip]

https://github.com/ruby/bigdecimal/commit/905d0345ec
2020-12-28 21:26:26 +09:00
Kenta Murata 80d9e457c5
[ruby/bigdecimal] Reduce conditional branch count in VpNewVarArg
https://github.com/ruby/bigdecimal/commit/741fb3e00f
2020-12-28 21:16:48 +09:00
Nobuyoshi Nakada 730b0099fd
Get rid of inconsistent dll linkages against vcpkg readline 2020-12-27 19:35:27 +09:00
Nobuyoshi Nakada 0a2e4a8f0c
Removed declarations conflicting on MinGW 2020-12-27 19:19:31 +09:00
Nobuyoshi Nakada 66719d7dc8 etc: use atomic operation instead of mutex 2020-12-24 11:43:21 +09:00
Nobuyoshi Nakada 6ed6b85ece Expose atomic operation macros with RUBY prefix
Now we need atomic operations, which are lighter than mutex, more
widely for extension libraries because of Ractor.
2020-12-24 11:43:21 +09:00
Kenta Murata 94015200b6
[fiddle] Update to 1.0.6 2020-12-23 23:40:04 +09:00
Hiroshi SHIBATA 684649ea05 [ruby/psych] Bump version to 3.3.0
https://github.com/ruby/psych/commit/0abce07b90
2020-12-23 19:53:21 +09:00
Kenta Murata aad88cc10b [ruby/date] Define dummy RUBY_TYPED_FROZEN_SHAREABLE for old Ruby
https://github.com/ruby/date/commit/9f3e90ad10
2020-12-23 18:32:24 +09:00
Marc-Andre Lafortune daec109f42 [ruby/psych] Optimize cache with `compare_by_identity`
Using `compare_by_identity` gives a 4x performance boost on cache hits.
Benchmark in https://github.com/JuanitoFatas/fast-ruby/issues/189
2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune c5a445d577 [ruby/psych] Make Ractor-ready.
Config is Ractor-local.

Benchmarking reveals that using `Ractor.local_storage` for storing cache
is similar to accessing a constant (~15% slower).
2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune 3ee0ad9190 [ruby/psych] Don't use instance variables directly for config 2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune d1963adae8 [ruby/psych] Avoid methods depending on bindings
Improves Ractor-readiness.
2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune 0eb94dae4a [ruby/psych] Freeze constants.
Improves Ractor-readiness.
2020-12-23 01:08:38 -05:00
Hiroshi SHIBATA 5cf25c55a6
Update version for Ractor-safe extensions 2020-12-23 14:03:54 +09:00
Marc-Andre Lafortune cd63f0358f [ruby/etc] Make Ractor safe 2020-12-22 19:46:07 -05:00
Marc-Andre Lafortune 3286380ebc [ruby/etc] Refactor locks using mutex API 2020-12-22 19:46:07 -05:00
Kenta Murata 01ab29cc28
[memory_view] Make some rb_memroy_view_t members const 2020-12-23 09:24:55 +09:00
Kenta Murata db0385d657
[memory_view] Remove needless use of StringValueCStr 2020-12-23 09:24:54 +09:00
Kenta Murata b3ea828c8e
[memory_view] Add mdview_release_view for test 2020-12-23 09:24:54 +09:00
Kenta Murata 74652e640a
[memory_view][fiddle] Rename len to byte_size in rb_memory_view_t 2020-12-23 09:24:53 +09:00
Kenta Murata 05014dcb88
[memory_view][fiddle] Use bool for boolean return value 2020-12-23 09:05:07 +09:00
Sutou Kouhei 32849dc1bb fiddle: Update to 1.0.5 2020-12-23 05:49:52 +09:00
Hiroshi SHIBATA 034c19ce28
Merge json-2.5.1 2020-12-22 21:51:15 +09:00
Hiroshi SHIBATA edb76e8765 Prepare to release json-2.5.0 2020-12-22 19:44:27 +09:00
Marc-Andre Lafortune f2f00e24fa [ruby/date] Make Ractor-compatible 2020-12-22 03:12:51 -05:00
Marc-Andre Lafortune ee102de6d7 [ruby/date] Deep-freeze internal constants.
Probably not strictly necessary, but good principle anyways.
2020-12-22 03:12:51 -05:00
Nobuyoshi Nakada 8918a9cf6c Removed rb_cData entity
* Use the wrapper of rb_cObject instead of data access
* Replaced rest of extentions
* Updated the version guard for Data
* Added the version guard of rb_cData
2020-12-22 02:51:49 +09:00
Kenta Murata 0b6a80c0be
[json] Avoid method redefinition 2020-12-21 22:41:24 +09:00
Kenta Murata 14d7d1df25
[json] Make json Ractor safe 2020-12-21 22:10:43 +09:00
Kenta Murata 4c2e7f26bd
[json] JSON_parse_float: Fix how to convert number
Stop BigDecimal-specific optimization.  Instead, it tries the conversion
methods in the following order:

1. `try_convert`,
2. `new`, and
3. class-named function, e.g. `Foo::Bar.Baz` function for `Foo::Bar::Baz` class

If all the above candidates are unavailable, it fallbacks to Float.
2020-12-21 22:10:43 +09:00
Kenta Murata 596da98b3f
[json] Make JSON.create_id thread-safe 2020-12-21 22:10:42 +09:00
Kenta Murata 98cc15ed1e
[json] Stop using prototype objects 2020-12-21 22:10:33 +09:00
Kenta Murata d8469507b9
[ruby/digest] Remove .gitignore and .travis.yml from gemspec
https://github.com/ruby/digest/commit/7b57b73f46
2020-12-21 17:46:30 +09:00
Kazuki Tsujimoto 67ee1cbdd5
Remove unnecessary files from .document
* ruby:ext/rbconfig/exts.mk
* ruby:ext/rbconfig/sizeof/Makefile
* ruby:ext/rbconfig/sizeof/depend
* ruby:ext/rbconfig/sizeof/mkmf.log
* ruby:ext/win32/depend
* ruby:ext/win32/exts.mk
* ruby:ext/win32/resolv/depend
* ruby:lib/racc/pre-setup
2020-12-20 16:00:13 +09:00
Koichi Sasada bcf4b236e4 ext/racc/cparse is ractor-safe 2020-12-20 04:22:29 +09:00
Koichi Sasada 846c4b03b8 ext/monitor is ractor-safe 2020-12-20 04:22:29 +09:00
Koichi Sasada c1461c927b cgi/escape is ractor-safe 2020-12-20 04:22:29 +09:00
Nobuyoshi Nakada c01ad11f90
bigdecimal: initialize conditionally assigned variable 2020-12-20 03:13:33 +09:00
Kenta Murata de80b92891
[pathname] Make Pathname Ractor safe (#3940) 2020-12-20 00:40:47 +09:00
Kenta Murata 8986f948e0
[bigdecimal] Version 3.0.0
https://github.com/ruby/bigdecimal/commit/e68f1eb33a
2020-12-19 22:13:59 +09:00
Kenta Murata df3deb3baa
[bigdecimal] Add BigDecimal#n_significant_digits
https://github.com/ruby/bigdecimal/commit/981dc48f95
https://github.com/ruby/bigdecimal/commit/9ecf880ec04
2020-12-19 22:13:59 +09:00
Kenta Murata 654f6fbf19
[bigdecimal] Make BigDecimal#precs deprecated
https://github.com/ruby/bigdecimal/commit/7e80e6e145
https://github.com/ruby/bigdecimal/commit/0ed7846e8c
2020-12-19 22:13:58 +09:00
Kenta Murata ff9e40811c
[bigdecimal] Add BigDecimal#precision
https://github.com/ruby/bigdecimal/commit/458eb66c49
2020-12-19 22:13:58 +09:00
Kenta Murata 928a06723d
[bigdecimal] Make bigdecimal Ractor safe
https://github.com/ruby/bigdecimal/commit/93fc392640
https://github.com/ruby/bigdecimal/commit/a90d13c4d0
2020-12-19 22:13:57 +09:00
Kenta Murata 97d4e72e0b
[bigdecimal] Use DBLE_FIG
https://github.com/ruby/bigdecimal/commit/12296dcb90
2020-12-19 22:13:57 +09:00
Kenta Murata e1424c3501
[bigdecimal] Fix the default precision of Float#to_d
Fix https://github.com/ruby/bigdecimal/issues/70
[Bug #13331]

https://github.com/ruby/bigdecimal/commit/aa536cd4b5
2020-12-19 22:13:53 +09:00
Nobuhiro IMAI e33eb09b76 ripper: fix `#tok` on some error events [Bug 17345]
sorting alias target by event arity, and setup suitable `Elem` for error.
2020-12-19 17:32:39 +09:00
Nobuyoshi Nakada 5c9d6ea6b4
Strip trailing spaces [ci skip] 2020-12-19 15:34:37 +09:00
Kenta Murata 0cb556b457
[digest] Version 3.0.0
https://github.com/ruby/digest/commit/4bbd247a32
2020-12-19 15:08:01 +09:00
Kenta Murata b66f52b0e3
[digest] Make digest Ractor safe
https://github.com/ruby/digest/commit/c13a024b85
https://github.com/ruby/digest/commit/9edca3f8be
https://github.com/ruby/digest/commit/378b56b6ca
2020-12-19 15:08:01 +09:00
Nobuyoshi Nakada feacae193c
[digest] Added rb_digest_make_metadata to wrap metadata
https://github.com/ruby/digest/commit/7046fe6005
2020-12-19 15:08:01 +09:00
Kenta Murata d5ab8e8562
[bigdecimal] Use rb_undef_alloc_func to undefine allocate 2020-12-19 02:29:31 +09:00
Koichi Sasada e76b56f58e support Ruby 2.x for openssl 2020-12-19 02:05:08 +09:00
Kenta Murata c71934f8a5
[stringio] Version 3.0.0
https://github.com/ruby/stringio/commit/831be01071
2020-12-18 22:00:07 +09:00
Kenta Murata e1b5289a2b
[stringio] Add test-unit in the development dependencies
https://github.com/ruby/stringio/commit/de010fc0e9
2020-12-18 22:00:07 +09:00
Kenta Murata 3d31944129
[stringio] Make stringio Ractor safe
https://github.com/ruby/stringio/commit/ee3fec7512
https://github.com/ruby/stringio/commit/18dcd045ef
https://github.com/ruby/stringio/commit/18dcd045ef
2020-12-18 22:00:07 +09:00
Kenta Murata 14ca7f633c
[openssl] Fix dependencies 2020-12-18 21:58:41 +09:00
Koichi Sasada b5588edc0a openssl is ractor-safe
ossl_bn_ctx is C's global variable and it should be ractor-local
to make it ractor-safe.
2020-12-18 18:19:33 +09:00
Kenta Murata b5de66e132
[strscan] Fix license comment and files
https://github.com/ruby/strscan/commit/a999f2c6d1
2020-12-18 14:25:48 +09:00
Kenta Murata 5370963992
[strscan] Version 3.0.0
https://github.com/ruby/strscan/commit/08645e4e77
2020-12-18 14:25:42 +09:00
Kenta Murata 985f0af257
[strscan] Make strscan Ractor safe (#17)
* Make strscan Ractor safe

* Add test-unit in the development dependencies

https://github.com/ruby/strscan/commit/3c93c2bebe
2020-12-18 14:25:41 +09:00
Koichi Sasada b44f7151c7 zlib is ractor-safe 2020-12-18 14:09:32 +09:00
Koichi Sasada a07f249803 socket is ractor-safe. 2020-12-18 11:23:34 +09:00
Hiroshi SHIBATA a09c3c6fe1
expand VERSION path for ruby repository. 2020-12-17 14:37:45 +09:00
Hiroshi SHIBATA 46ea74297e
Bump version to json-2.4.1 and use VERSION file for json version same as upstream 2020-12-17 14:20:42 +09:00
Kenta Murata 1bafb3cb47
[memory_view] Make MemoryView API Ractor-safe (#3911)
* memory_view.c: make Ractor-safe

* test/ruby/test_memory_view.rb: Add test_ractor

* memory_view: fix typo

* memory_view.c: Use st_update in unregster_exported_object

* memory_view: update dependency
2020-12-16 13:43:56 +09:00
Nobuyoshi Nakada e0bdd54348 Ripper: Refined error callbacks [Bug #17345] 2020-12-15 21:36:23 +09:00
Hiroshi SHIBATA ad3e3bd65a
Bump version to json-2.4.0 2020-12-15 19:54:58 +09:00
Kenta Murata a86c147579
Import bigdecimal 2.0.2 (#3905)
* remove duplicated include

* Make BigDecimal#round with argument < 1 return Integer

Fixes [Bug #12780]

* Use a higher default precision for BigDecimal#power and #**

When a fractional power is given, increase the precision if the
precision isn't specified via power's second argument:

Float: increase by 15 (rough number of decimal precision in float)
BigDecimal: increase by adding similar precision modifier as done to
            calculate the base precision.
Rational: double the precision, since a BigDecimal is created, but
          the created BigDecimal uses the same precision.

Increasing the precision for these power calculations has the obvious
tradeoff of making the calculations slower.

Fixes Ruby Bug #17264

* Use DBLE_FIG for a Float value

* Version 2.0.1

Co-authored-by: pavel <pavel.rosicky@easy.cz>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
2020-12-15 15:17:15 +09:00
Nobuyoshi Nakada 7898f4243f
ripper: return pushed new token instead of the token list 2020-12-15 10:26:50 +09:00
Alan Wu a5fd651575 Reword docs for Fiddle::Function#call [ci skip]
I'm using `<code>` instead of `+` since `+` only works when it encloses
a single word.
2020-12-14 18:26:32 -05:00
Hiroshi SHIBATA c2a60fec2f
Merge Psych-3.2.1 from ruby/psych 2020-12-14 20:13:12 +09:00
Masaki Matsushita 56918578ea Remove unimplemented parameter from comment
:resolv_timeout of TCPSocket.new is not implemented for now.
2020-12-11 11:13:24 +09:00
Kenta Murata 9b0c36b390
Import fiddle-1.0.4 (#3860)
I don't use tool/sync_default_gem.rb because the last sync was incomplete.

Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: sinisterchipmunk <sinisterchipmunk@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2020-12-11 09:41:12 +09:00
Masaki Matsushita 78f188524f Add connect_timeout to TCPSocket
Add connect_timeout to TCPSocket.new in the same way as Socket.tcp.

Closes [Feature #17187]
2020-12-10 20:52:29 +09:00
Kenta Murata bb489aca58
memory_view.c: Add rb_memory_view_get_item and rb_memory_view_prepare_item_desc (#3871) 2020-12-10 00:24:36 +09:00
Kenta Murata 7e69296a2b
memory_view.c: Add rb_memory_view_extract_item_members (#3855) 2020-12-08 02:01:31 +09:00
Masaki Matsushita 5d8bcc4870 Revert getaddrinfo_a()
getaddrinfo_a() gets stuck after fork().
To avoid this, we need 1 second sleep to wait for internal
worker threads of getaddrinfo_a() to be finished, but that is unacceptable.

[Bug #17220] [Feature #17134] [Feature #17187]
2020-12-07 13:33:53 +09:00
Kenta Murata 60eabb1aa7
Revert "memory_view.c: Add rb_memory_view_extract_item_members"
This reverts the following three commits.

- ce707079c1
- 1a76bb56b0
- 51500eedef
2020-12-07 00:38:19 +09:00
Kenta Murata 51500eedef
memory_view.c: Add rb_memory_view_extract_item_members 2020-12-06 22:46:06 +09:00
Masaki Matsushita 76439eee68 Call cleanup function for getaddrinfo_a(3) only before fork()
Previously, rb_getaddrinfo_a_before_exec() is called from before_exec().
However, the function needs to be called only before fork().
The change moves it to before_fork().
2020-12-06 01:32:43 +09:00
Masaki Matsushita c56a1c1953 Extend sleep time to 1.5 second in rb_getaddrinfo_a_before_exec()
After 94d49ed31c, TestSocket#test_getaddrinfo_after_fork fails in some
platforms. To avoid this, the change extends sleep time to 1.5 second.
2020-12-06 01:01:13 +09:00
Nobuyoshi Nakada d2b7e1e4b2
Protoized old pre-ANSI K&R style definitions 2020-12-05 14:57:31 +09:00
Masaki Matsushita 94d49ed31c Add a hook before fork() for getaddrinfo_a()
We need stop worker threads in getaddrinfo_a() before fork().
This change adds a hook before fork() that cancel all outstanding requests
and wait for all ongoing requests. Then, it waits for all worker
threads to be finished.

Fixes [Bug #17220]
2020-12-04 23:31:51 +09:00
Jeremy Evans 0adc426ca5 [ruby/zlib] Add Zlib::Inflate#inflate :buffer keyword argument
If a buffer keyword argument is given, it is used as the buffer,
instead of creating new strings.  This can result in significantly
lower memory usage during inflation.

Implements #19

https://github.com/ruby/zlib/commit/dac9a9b57d
2020-12-04 19:12:32 +09:00
Jeremy Evans bc63ec57e7 [ruby/zlib] Allow Zlib.crc32 and .adler32 to accept IO instance
This reads from the IO in 8192 byte chunks, so you don't need to
have the entire string in memory.

Fixes #16

https://github.com/ruby/zlib/commit/ba9793c550
2020-12-04 19:12:20 +09:00
Jeremy Evans a60dfff434 [ruby/zlib] Document that gets can return nil when eof? returns false
This behavior differs from File#gets.

Fixes [Bug #13904]

https://github.com/ruby/zlib/commit/448e41efdd
2020-12-04 19:11:30 +09:00
aycabta 5b1ebb8ead
[ruby/readline-ext] Rename depend.gem with depend-gem
https://github.com/ruby/readline-ext/commit/897ffe26a6
2020-12-03 17:35:29 +09:00
aycabta b526db85fe
[ruby/readline-ext] Version 0.1.1
https://github.com/ruby/readline-ext/commit/6d55854434
2020-12-03 17:35:29 +09:00
aycabta b619197dfa
Use gemified depend 2020-12-03 17:35:29 +09:00
Nobuyoshi Nakada eab4aa4178
[ruby/io-wait] Added extensions
https://github.com/ruby/io-wait/commit/664c93b2ff
2020-12-03 17:35:29 +09:00
Nobuyoshi Nakada 09266eccf4
[ruby/io-wait] Fixed regexp to reject .travis* at the toplevel only
https://github.com/ruby/io-wait/commit/4434b10e46
2020-12-03 17:35:29 +09:00
Nobuyoshi Nakada 7fcbe07d61
[ruby/io-wait] Exclude dot-files for CIs
https://github.com/ruby/io-wait/commit/12cce69ddf
2020-12-03 17:35:29 +09:00
Nobuyoshi Nakada 09bcb935ec
[ruby/io-wait] Fix ls-files matching regexp
See rubygems/rubygems@8a81183236.

https://github.com/ruby/io-wait/commit/04857e0cf5
2020-12-03 17:35:29 +09:00
Nobuyoshi Nakada 2800e9f347
[ruby/io-nonblock] Added extensions
https://github.com/ruby/io-nonblock/commit/8b7abbd1b5
2020-12-03 17:35:29 +09:00
Nobuyoshi Nakada 7820162018
[ruby/io-nonblock] Exclude dot-files for CIs
https://github.com/ruby/io-nonblock/commit/9fa3ad9c7a
2020-12-03 17:35:28 +09:00
Nobuyoshi Nakada 7d0a6e28f2
[ruby/io-nonblock] Fix ls-files matching regexp
See rubygems/rubygems@8a81183236.

https://github.com/ruby/io-nonblock/commit/e14f7952c1
2020-12-03 17:35:28 +09:00
Hiroshi SHIBATA 412a0f5240
[ruby/digest] LICENSE
https://github.com/ruby/digest/commit/aa048ce345
2020-12-03 17:35:28 +09:00
Hiroshi SHIBATA 7324d76da4
[ruby/digest] Fixup d981714348f71177132426e3ac19598e1b2e8f5d
https://github.com/ruby/digest/commit/502a12587c
2020-12-03 17:35:28 +09:00
卜部昌平 43b95bafd5
delete deprecated IO-like methods
This commit deletes
{IO,ARGF,StringIO,Zib::GZipReader}#{bytes,chars,lines,codepoints}, which
have been deprecated since c47c095b97.

Note that String also has those methods.  They are neither depreacted
nor deleted because they are not aliases of counterpart each_something.
2020-12-03 12:47:51 +09:00
Kazuki Yamaguchi 2e601c284c digest: remove OpenSSL engine
The OpenSSL engine of Digest uses the low-level API of OpenSSL, whose
use has been discouraged for years for multiple reasons.

A long-standing issue on a FIPS-enabled system is that using ::Digest
results in crashing the Ruby process, because the low-level API lacks
the mechanism to report an error (the policy violation) and thus kills
the process as a last resort[1][2]. Also, the upcoming OpenSSL 3.0 will
deprecate it for future removal[3]. Compiling with
-Wdeprecated-declarations will start to emit warnings.

A proper fix for this is to make it use the EVP API instead. This is a
non-trivial work as it requires backwards-incompatible changes to the
framework interface of Digest::Base and rb_digest_metadata_t.

It is more than 15 years ago that the openssl library became part of the
standard library. It has implemented the exactly same functionality as
OpenSSL::Digest, in fact, as a subclass of Digest::Class. There is not
much point in having an identical code in the digest library. Let's
just get rid of OpenSSL within digest. This leaves the C implementations
and the CommonCrypto engine for Apple systems.

A patch is being prepared for the openssl library to provide ::Digest
constants for better performance[4].

[1] https://bugs.ruby-lang.org/issues/6946
[2] https://bugs.ruby-lang.org/issues/13681
[3] https://www.openssl.org/docs/OpenSSL300Design.html
[4] https://github.com/ruby/openssl/pull/377
2020-12-02 11:09:12 +09:00
Cristian Greco 95bb49d425 Fix code example in Readline::HISTORY documentation.
Wrapping the example into a <code> block to avoid it being rendered as a link.
2020-12-02 10:59:53 +09:00
Kenta Murata 82dc0c6aa3
memory_view.c: Check availability in rb_memory_view_get 2020-12-02 09:44:03 +09:00
Nobuyoshi Nakada d5e16161f6
Update ext/.document 2020-12-01 17:35:28 +09:00
Kazuhiro NISHIYAMA 1ca9facab6
Add monitor to document files 2020-12-01 16:07:38 +09:00
Jean Boussier 6bef49427a Fix rb_interned_str_* functions to not assume static strings
Fixes [Feature #13381]

When passed a `fake_str`, `register_fstring` would create new strings
with `str_new_static`. That's not what was expected, and answer
almost no use cases.
2020-11-30 17:33:28 +09:00
Kenta Murata 73a337e214
Keep references of memory-view-exported objects (#3816)
* memory_view.c: remove a reference in view->obj at rb_memory_view_release

* memory_view.c: keep references of memory-view-exported objects

* Update common.mk

* memory_view.c: Use st_update
2020-11-30 14:53:13 +09:00
Nobuyoshi Nakada f5ca3ff4db
Store all kinds of syntax errors [Bug #17345] 2020-11-26 20:14:34 +09:00
Nobuyoshi Nakada 48d1e8682c
zlib: patches for mswin64
* cast to suppress C4267 warnings; no possible loss of data as
  following the comparison.

* shift base address to suppress LNK4281; although /DYNAMICBASE is
  preferable, not sure from which version of link.exe supports it.
2020-11-24 08:27:08 +09:00
Nobuyoshi Nakada 78c40e6588
zlib: extlibs to download zlib-1.2.11 2020-11-24 08:22:54 +09:00
Lars Kanis d403591b34
Add string encoding IBM720 alias CP720 (#3803)
The mapping table is generated from the ICU project:
  https://github.com/unicode-org/icu/blob/master/icu4c/source/data/mappings/ibm-720_P100-1997.ucm

Fixes bug 16233 : https://bugs.ruby-lang.org/issues/16233
2020-11-22 22:23:40 +09:00
Nobuhiro IMAI 4f5d14eb8c [DOC] Ripper.{lex,tokenize} now always return full tokens. [ci skip] 2020-11-20 15:46:17 -08:00
Nobuyoshi Nakada 69d871eeeb
[Feature #17276] Moved raise_errors support to Ripper::Lexer#parse 2020-11-20 17:18:27 +09:00
Nobuhiro IMAI 1800f3fa5c
Ripper.{lex,tokenize} return full tokens even if syntax error
yet another implements [Feature #17276]
2020-11-20 11:44:57 +09:00
Kevin Murphy 0026f644d7 Document Different Coverage Modes
This commits adds in documentation to illustrate the different modes you
can start coverage with. Examples are provided to show how to start each
of these modes, along with an explanation of the mode and a description
of the output.
2020-11-20 09:24:46 +09:00
Jeremy Evans 1301bd8ca9 Update documentation for Ripper.{lex,tokenize,sexp,sexp_raw} [ci skip] 2020-11-17 21:26:56 -08:00
Jeremy Evans cd0877a93e
Support raise_errors keyword for Ripper.{lex,tokenize,sexp,sexp_raw}
Implements [Feature #17276]
2020-11-17 21:15:50 -08:00
Sutou Kouhei 0915a02068 Update Fiddle's dependencies 2020-11-18 09:05:13 +09:00
Sutou Kouhei fcd680fbf0 [ruby/fiddle] Remove needless return
https://github.com/ruby/fiddle/commit/50e02f9445
2020-11-18 09:05:13 +09:00
Sutou Kouhei aa22b6658a [ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/74b65cb858
2020-11-18 09:05:13 +09:00
Sutou Kouhei ceccc16589 [ruby/fiddle] Remove needless workaround
It's fixed in upstream.
https://github.com/MSP-Greg/ruby-loco/issues/4

https://github.com/ruby/fiddle/commit/2ae0ff4934
2020-11-18 09:05:13 +09:00
Sutou Kouhei 3b385c33b8 [ruby/fiddle] Add workaround for ruby head for mingw
https://github.com/ruby/fiddle/commit/bb227c206d
2020-11-18 09:05:13 +09:00
Sutou Kouhei 821cfa74cb [ruby/fiddle] Use msys2_mingw_dependencies
https://github.com/ruby/fiddle/commit/fee175a8ff
2020-11-18 09:05:13 +09:00
Sutou Kouhei e27701291a [ruby/fiddle] Use ruby_xcalloc() instead of ruby_xmalloc() and memset()
https://github.com/ruby/fiddle/commit/6d24fb5438
2020-11-18 09:05:13 +09:00
Sutou Kouhei 1867088d90 [ruby/fiddle] Remove needless rescue
GitHub: fix GH-15

Reported by Eneroth3. Thanks!!!

https://github.com/ruby/fiddle/commit/f3d70b81ec
2020-11-18 09:05:13 +09:00
Sutou Kouhei aff5eaced4 [ruby/fiddle] Add workaround for RubyInstaller for Windows
See comment for details.

https://github.com/ruby/fiddle/commit/0c76f03dc4
2020-11-18 09:05:13 +09:00
Aaron Patterson 307388ea19 [ruby/fiddle] Add a "pinning" reference (#44)
* Add a "pinning" reference

A `Fiddle::Pinned` objects will prevent the objects they point to from
moving.  This is useful in the case where you need to pass a reference
to a C extension that keeps the address in a global and needs the
address to be stable.

For example:

```ruby
class Foo
  A = "hi" # this is an embedded string

  some_c_function A # A might move!
end
```

If `A` moves, then the underlying string buffer may also move.
`Fiddle::Pinned` will prevent the object from moving:

```ruby
class Foo
  A = "hi" # this is an embedded string

  A_pinner = Fiddle::Pinned.new(A) # :nodoc:

  some_c_function A # A can't move because of `Fiddle::Pinned`
end
```

This is a similar strategy to what Graal uses:

  https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/PinnedObject.html#getObject--

* rename global to match exception name

* Introduce generic Fiddle::Error and rearrange error classes

Fiddle::Error is the generic exception base class for Fiddle exceptions.
This commit introduces the class and rearranges Fiddle exceptions to
inherit from it.

https://github.com/ruby/fiddle/commit/ac52d00223
2020-11-18 09:05:13 +09:00
Sutou Kouhei e2dfc0c26b [ruby/fiddle] Add support for specifying types by name as String or Symbol
For example, :voidp equals to Fiddle::TYPE_VOID_P.

https://github.com/ruby/fiddle/commit/3b4de54899
2020-11-18 09:05:13 +09:00
Sutou Kouhei ae7b53546c [ruby/fiddle] Add TYPE_CONST_STRING and SIZEOF_CONST_STRING for "const char *"
Add rb_fiddle_ prefix to conversion functions.h to keep backward
compatibility but value_to_generic() isn't safe for TYPE_CONST_STRING
and not String src. Use rb_fiddle_value_to_generic() instead.

https://github.com/ruby/fiddle/commit/0ffcaa39e5
2020-11-18 09:05:13 +09:00
Koichi Sasada 5e3259ea74 fix public interface
To make some kind of Ractor related extensions, some functions
should be exposed.

* include/ruby/thread_native.h
  * rb_native_mutex_*
  * rb_native_cond_*
* include/ruby/ractor.h
  * RB_OBJ_SHAREABLE_P(obj)
  * rb_ractor_shareable_p(obj)
  * rb_ractor_std*()
  * rb_cRactor

and rm ractor_pub.h
and rename srcdir/ractor.h to srcdir/ractor_core.h
    (to avoid conflict with include/ruby/ractor.h)
2020-11-18 03:52:41 +09:00
Akira Matsuda 028d52bb94 [ruby/date] Numeric already includes Comparable
https://github.com/ruby/date/commit/f6140df0ad
2020-11-12 21:35:17 +09:00
Nobuyoshi Nakada 33574d57f1 [ruby/date] Updated timezones from timeanddate.com
https://github.com/ruby/date/commit/f08175e34d
2020-11-12 21:35:06 +09:00
Nobuyoshi Nakada 81dece54d6 [ruby/date] Honor timezones from timeanddate.com
https://github.com/ruby/date/commit/d20380fc55
2020-11-12 21:34:54 +09:00
Nobuyoshi Nakada d65f1140b9 [ruby/date] Fixed the script file name to update zonetab.list
https://github.com/ruby/date/commit/3c002b1daa
2020-11-12 21:34:43 +09:00
NARUSE, Yui 0fdcb947e8 [ruby/date] [DOC] declate DateTime class is deprecated
https://github.com/ruby/date/commit/58ca6e6a3e
2020-11-12 21:34:31 +09:00
Hiroshi SHIBATA dd07354f27 Use Fiddle::Importer directly 2020-11-11 09:27:36 +09:00
Hiroshi SHIBATA 5081bd9675 Removed win32/resolv.rb for 32bit env 2020-11-11 09:27:36 +09:00
Hiroshi SHIBATA ff67aac193 Removed win32api 2020-11-11 09:27:36 +09:00
NAKAMURA Usaku 9728cb730f
Use fiddle (win32/importer) instead of Win32API
- ext/win32/lib/win32/sspi.rb: Use fiddle (win32/importer) instead of Win32API
2020-11-10 14:45:15 +09:00
Hiroshi SHIBATA 17e7a819f7 Complex and Rational is embedded classes now 2020-11-10 13:14:42 +09:00
Rei Odaira 305c79af2f ext/socket/rubysocket.h: avoid the conflict of T_DATA definition in AIX 2020-11-01 00:12:55 -05:00
Hiroshi SHIBATA a1828a1ff4
Promote win32ole to default gems.
But win32ole gem is still experimental for 3.0.0-preview2.
  I'm working to extract this library on https://github.com/ruby/win32ole.
2020-10-30 15:18:50 +09:00
Aaron Patterson 9f3adaf529 Use public allocators for creating new T_OBJECT objects
This way the header flags and object internals are set correctly
2020-10-28 18:35:22 -07:00
Nobuyoshi Nakada 5a77e90fe8
Use rb_intern_const instead of rb_intern in Init functions
```
find . -name \*.o -exec nm {} + |&
sed '/Init_.*\.rbimpl_id/!d;s/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' |
uniq
```
should be empty.
2020-10-21 12:46:53 +09:00
Stefan Stüben 8c2e5bbf58 Don't redefine #rb_intern over and over again 2020-10-21 12:45:18 +09:00
Nobuyoshi Nakada d497436d07
Update dependencies for macOS 2020-10-21 12:31:45 +09:00
Jean Boussier 520e0916af
Implement a freeze: parser option
If set to true all parsed objects will be
immediately frozen, and strings will be
deduplicated if the Ruby implementation
allows it.
2020-10-20 21:40:25 +09:00
Hiroshi SHIBATA 3f97940252
Followed up with 708413807a
* Added sync task for digest
  * Update doc/* for default gems
  * Update the latest version of gemspec
2020-10-19 18:56:19 +09:00
Hiroshi SHIBATA 708413807a
Revisit to promote digest to default gems.
This reverts commit f39021be7e.
2020-10-19 18:38:09 +09:00
Aaron Patterson ff9dc10966
keep proc on the stack so it does not move 2020-10-16 11:28:52 -07:00
Hiroshi SHIBATA 9aab916990
Promote pathname to default gems 2020-10-14 14:42:53 +09:00
Nobuyoshi Nakada 27b48089e2
Adjusted indents [ci skip] 2020-10-11 14:22:43 +09:00
Nobuyoshi Nakada fddffa4c7a
Respect the original styles [ci skip] 2020-10-11 11:57:32 +09:00
Nobuyoshi Nakada 71428ac264 [ruby/io-console] Refined getch warnings
https://github.com/ruby/io-console/commit/f84e6abcce
2020-10-11 02:00:28 +09:00
Nobuyoshi Nakada 37259e878f [ruby/io-console] Relaxed min: option warning
When `min: 0` is given to `IO#getch` with `time:` option, it is
expected to return nil if timed out, and needed for source code
the compatibility with unixen platforms.

https://github.com/ruby/io-console/commit/a2afbe72bd
2020-10-11 02:00:26 +09:00
Nobuyoshi Nakada a79966743c [ruby/io-console] Fix timeout type error (#18)
Fixed TypeError when IO#getch timed out

`rb_io_wait` returns a bit-flags Integer representing available
events, or Qfalse if timed out.  Also the result of `NUM2INT` is
not a `VALUE`.

```
$ ./bin/ruby -v -rio/console -e "p IO.console.getch(intr: true, time: 0.1)"
ruby 3.0.0dev (2020-10-09T20:27:30Z master 5ea2ea74cc) [x64-mingw32]
-e:1:in `getch': no implicit conversion of false into Integer (TypeError)
        from -e:1:in `<main>'
```

https://github.com/ruby/io-console/commit/3bdfaf62df
2020-10-11 02:00:24 +09:00
Nobuyoshi Nakada b59640e155
[ruby/io-console] Fixed "Rework console to use `rb_io_wait`."
* Fixed backward compatibility.
* Added missing `rb_scheduler_timeout` declaration.

https://github.com/ruby/io-console/commit/813806079f
2020-10-11 01:27:15 +09:00
Ikko Ashimine df25007046 Fixed typo in comment
alway -> always
2020-10-10 02:32:21 -04:00
Aaron Patterson cdc4084b0a Prevent objects from moving while iterating the heap
This iterator uses an st_table, but if objects move the references in
the st table won't be updated.  This patch just changes the st table to
an identity hash.
2020-10-06 16:22:01 -07:00
Nobuyoshi Nakada 21b199bb24
Appended a newline to suppress newline-eof warning 2020-10-06 23:18:42 +09:00
卜部昌平 ae94c5bf5d STRUCT_ALIGNOF: use RUBY_ALIGNOF
This was a workaround for RUBY_ALIGNOF's glitch, which has already been
fixed.  See also https://github.com/ruby/ruby/pull/3570
2020-10-06 14:20:10 +09:00
Aaron Patterson 6aa466ba9c mark regex internal to string scanner 2020-10-02 12:01:57 -07:00
Kazuhiro NISHIYAMA d0a7189f26 Fix ObjectSpace.dump(obj, output: :stdout)
RDoc says `ObjectSpace.dump(obj, output: :stdout)   # => nil`,
but it returns STDOUT since fbba6bd4e3.

I think it is unintentional change.
2020-10-03 00:00:01 +09:00
Kenta Murata c827cacde1
memory_view.c: Use ssize_t for ndim in memory_view (#3615)
* memory_view.c: Use ssize_t for ndim in memory_view

* include/ruby/memory_view.h: Fix the type of item_size argument
2020-10-02 08:04:25 +09:00
Nobuyoshi Nakada 9501b34dfc
strip trailing spaces [ci skip] 2020-09-30 19:40:30 +09:00
Nobuyoshi Nakada b971f141b2
Fix up dependencies on internal/sanitizers.h 2020-09-29 13:14:54 +09:00
Aaron Patterson 0b0e2d88ce Refactor common heap iteration code
We have code common to all heap iteration paths in this file.  Refactor
such that we keep ASAN checks and flags checks in one place
2020-09-28 08:20:23 -07:00
Aaron Patterson b9488accf9 Fix ASAN support when invalidating CCs
Again, this code is walking the heap.  Empty slots can be poisoned, so
we need to unpoison before checking the type
2020-09-28 08:20:23 -07:00
Aaron Patterson b328b83026 make ext/coverage ASAN friendly 2020-09-28 08:20:23 -07:00
Aaron Patterson 18b3f0f54c Make ext/objspace ASAN friendly
ext/objspace iterates over the heap, but some slots in the heap are
poisoned, so we need to take care of that when running with ASAN
2020-09-28 08:20:23 -07:00
Yusuke Endoh 950614b088 ext/socket/ipsocket.c: prevent "warning: unused variable 'resolv_timeout'" 2020-09-27 02:38:39 +09:00
NARUSE, Yui 4e31cbc070 update-deps
https://github.com/ruby/ruby/runs/1169621878
2020-09-26 18:55:00 +09:00
Alan Wu 24820d508b Return nil when argument to ObjectSpace.internal_class_of is T_IMEMO
The added test case crashes the interpreter because it makes
ObjectSpace.internal_class_of return the second VALUE slot of an AST
imemo object. The second VALUE slot of `struct rb_ast_struct` is
not a VALUE and not a pointer to a Ruby object.
2020-09-25 09:27:49 -07:00
Kenta Murata 3a00f2a0f4
ext/readline/depend: update-deps --fix 2020-09-26 00:34:27 +09:00
aycabta f4328d7f5d [ruby/readline-ext] Remove unnecessary header files from depend
https://github.com/ruby/readline-ext/commit/f9783c0739
2020-09-25 21:34:34 +09:00
Kenta Murata 890bc2cdde
Buffer protocol proposal (#3261)
* Add buffer protocol

* Modify for some review comments

* Per-object buffer availability

* Rename to MemoryView from Buffer and make compilable

* Support integral repeat count in memory view format

* Support 'x' for padding bytes

* Add rb_memory_view_parse_item_format

* Check type in rb_memory_view_register

* Update dependencies in common.mk

* Add test of MemoryView

* Add test of rb_memory_view_init_as_byte_array

* Add native size format test

* Add MemoryView test utilities

* Add test of rb_memory_view_fill_contiguous_strides

* Skip spaces in format string

* Support endianness specifiers

* Update documentation

* Support alignment

* Use RUBY_ALIGNOF

* Fix format parser to follow the pack format

* Support the _ modifier

* Parse count specifiers in get_format_size function.

* Use STRUCT_ALIGNOF

* Fix test

* Fix test

* Fix total size for the case with tail padding

* Fix rb_memory_view_get_item_pointer

* Fix rb_memory_view_parse_item_format again
2020-09-25 20:32:02 +09:00
Jean Boussier 927a377a7c [flori/json] Fix JSON.load_file doc
https://github.com/flori/json/commit/cb61a00ba8
2020-09-25 17:28:42 +09:00
BurdetteLamar 038252fe66 [flori/json] Partial compliance with doc/method_documentation.rdoc
https://github.com/flori/json/commit/6dfa885134
2020-09-25 17:28:42 +09:00
Burdette Lamar 71f64e15b9 [flori/json] Enhanced RDoc for JSON.dump (#443)
* Enhanced RDoc for JSON.dump
https://github.com/flori/json/commit/03f1699ec4
2020-09-25 17:28:42 +09:00
Julien Feltesse 3d5e833998 bundle the LICENSE file in the gem 2020-09-25 17:28:42 +09:00
BurdetteLamar de0e0ffad4 [flori/json] Nodoc for recurse_proc
https://github.com/flori/json/commit/f8c0fe2408
2020-09-25 17:28:42 +09:00
BurdetteLamar e9096f796c [flori/json] RDoc for JSON.load with proc
https://github.com/flori/json/commit/a55c91934e
2020-09-25 17:28:42 +09:00
Karol Bucek f8d43e5370 unify json-java gemspec with the baseline 2020-09-25 17:28:42 +09:00
BurdetteLamar 8c057bb845 [flori/json] RDoc example for JSON.load
https://github.com/flori/json/commit/e4eead665c
2020-09-25 17:28:42 +09:00
BurdetteLamar 36b2177ea8 [flori/json] Enhance RDoc for JSON.parse
https://github.com/flori/json/commit/33e64ef255
2020-09-25 17:28:42 +09:00
BurdetteLamar 71b1bbad02 [flori/json] Move options from #generate and #parse to common area
https://github.com/flori/json/commit/20d7be605a
2020-09-25 17:28:42 +09:00
Keith Bennett c3614877d2 [flori/json] Add `load_file` and `load_file!` methods, with tests. Fixes issue #386.
https://github.com/flori/json/commit/0be363c99b
2020-09-25 17:28:42 +09:00
Jean Boussier e1659af372 Add an option to escape forward slash character
Squashed commit of the following:

commit 26d181059989279a79c433cedcd893b4f52e42ee
Author: Francois Chagnon <francois.chagnon@jadedpixel.com>
Date:   Tue Sep 15 21:17:34 2015 +0000

    add config options for escape_slash

commit fa282334051b16df91ca097dd7304b46f3bc7719
Author: Francois Chagnon <francois.chagnon@jadedpixel.com>
Date:   Mon Feb 9 21:09:33 2015 +0000

    add forward slash to escape character
2020-09-25 17:28:42 +09:00
Masaki Matsushita f2d1808e73 Add comments for resolv_timeout 2020-09-25 15:39:26 +09:00
Masaki Matsushita 511fe23fa2 Add resolve_timeout to TCPSocket [Feature #17134] 2020-09-25 15:19:14 +09:00
Jean Boussier b72f9200ac
[ruby/psych] Forward keyword arguments in load_file and load_stream
https://github.com/ruby/psych/commit/4e1dd37f09
2020-09-25 13:11:33 +09:00
Hiroshi SHIBATA 8ea1021f19
[ruby/psych] Bump version to 3.2.0
https://github.com/ruby/psych/commit/181a727c90
2020-09-25 13:11:33 +09:00
SzymonKowalczyk 263c43487f
[ruby/psych] Revert psych version
https://github.com/ruby/psych/commit/55a294fcd0
2020-09-25 13:11:33 +09:00
SzymonKowalczyk f794c928a0
[ruby/psych] Update SNAKEYAML CVE-2017-18640
to version 1.26
https://github.com/ruby/psych/commit/b2802135e7
2020-09-25 13:11:32 +09:00
Charles Oliver Nutter 33641e00cd
Remove private_iv_get
The only remaining use of this function was to get the internal
message object from an exception's hidden `mesg` instance
variable to allow it to be dumped wiithout converting to a string.

As discussed in #103, this exposes internal implementation details
of CRuby, and ultimately does not provide any real utility to the
user since they can't directly inspect this hidden variable. The
test change here is to reflect CRuby behavior that denies equality
if the internal message objects do not match, as is the case after
the exception has been loaded and now has a simple String value.

The impact to users is that exceptions with special hidden message
objects will convert those objects to String during marshaling
through YAML. I believe this only affects NameError and its
descendants, since users can't set this field directly on their
own exception types.

Fixes #103.
2020-09-25 13:11:32 +09:00
卜部昌平 4cc501bcfd ext/-test-/RUBY_ALIGNOF: skip C++ when no compiler
C++ compilers are optional.  Skip C++ tests when they are absent.
2020-09-25 11:38:33 +09:00
卜部昌平 0b77a86d1e ext/-test-/RUBY_ALIGNOF: add minimalistic test
Check if RUBY_ALIGNOF(double) is the alignment to store a double inside
of a struct.
2020-09-25 11:38:33 +09:00
Nobuyoshi Nakada 73a626c078
[ruby/io-wait] update required_ruby_version
As d387029f39 made io/wait
unbuildable with older versions, drop older versions tentatively.
Also the change seems to instroduce behavioral incompatibilities,
may address them or bump up the version later.
2020-09-19 17:47:40 +09:00
Nobuyoshi Nakada 702cebf104
strip trailing spaces [ci skip] 2020-09-19 17:40:54 +09:00
Jean Boussier fbba6bd4e3 Parse ObjectSpace.dump_all / dump arguments in Ruby to avoid allocation noise
[Feature #17045] ObjectSpace.dump_all should allocate as little as possible in the GC heap

Up until this commit ObjectSpace.dump_all allocates two Hash because of `rb_scan_args`.

It also can allocate a `File` because of `rb_io_get_write_io`.

These allocations are problematic because `dump_all` dumps the Ruby
heap, so it should try modify as little as possible what it is
observing.
2020-09-15 09:18:13 -07:00
Marc-Andre Lafortune 39312cf4d6 Optimize Pathname#relative? / absolute? 2020-09-14 14:18:23 -04:00
Jeremy Evans d52dffd817 [ruby/zlib] Add Zlib::GzipReader.zcat for handling multiple gzip streams in gz file
Most gzip tools support concatenated gz streams in a gz file. This
offers a way to handle such gz files in Ruby.

Fixes [Bug #9790]
Fixes [Bug #11180]
Fixes [Bug #14804]

https://github.com/ruby/zlib/commit/e2ce56de7d
2020-09-14 17:52:20 +09:00
Samuel Williams 7fca274198 Rework console to use `rb_io_wait`. 2020-09-14 16:44:09 +12:00
Samuel Williams d387029f39 Standardised scheduler interface. 2020-09-14 16:44:09 +12:00
Kazuhiro NISHIYAMA 406559a268
Add missing break
pointed out by Coverity Scan
2020-09-11 11:02:24 +09:00
Hiroshi SHIBATA 867204c4a5
Promote syslog to default gems 2020-09-10 20:42:53 +09:00
Jean Boussier 5001cc4716 Optimize ObjectSpace.dump_all
The two main optimization are:
  - buffer writes for improved performance
  - avoid formatting functions when possible

```

|                   |compare-ruby|built-ruby|
|:------------------|-----------:|---------:|
|dump_all_string    |       1.038|   195.925|
|                   |           -|   188.77x|
|dump_all_file      |      33.453|   139.645|
|                   |           -|     4.17x|
|dump_all_dev_null  |      44.030|   278.552|
|                   |           -|     6.33x|
```
2020-09-09 11:11:36 -07:00
Jean Boussier b49a870414 Add a :since option to dump_all
This is useful to see what a block of code allocated, e.g.

```
GC.start
GC.disable
ObjectSpace.trace_object_allocations do
  # run some code
end
gc_gen = GC.count
allocations = ObjectSpace.dump_all(output: :file, since: gc_gen)
GC.enable
GC.start
retentions = ObjectSpace.dump_all(output: :file, since: gc_gen)
```
2020-09-09 08:05:14 -07:00
Kazuhiro NISHIYAMA 5be75aad37
Add FALLTHROUGH
Pointed out by Coverity Scan

```
** CID 1466646: Control flow issues (MISSING_BREAK)
/ext/-test-/random/loop.c: 63 in loop_get_bytes()
```
2020-09-08 10:30:07 +09:00
Nobuyoshi Nakada 2b07b24bdf Added `rb_random_base_init`
To enclose the initialization of Random::Base part.
2020-09-07 20:08:01 +09:00
Nobuyoshi Nakada 4924011262 Added WITH_REAL macros
Added `WITH_REAL` versions to `RB_RANDOM_INTERFACE` macros.  Also
these macros including "without real" versions no longer contain
the terminator (semicolon and comma).
2020-09-07 20:08:01 +09:00
Nobuyoshi Nakada d6ec0ef59b Added `get_real` interface 2020-09-07 20:08:01 +09:00
Nobuyoshi Nakada af5e87ab21 separate rb_random_t
* random.c: separate abstract rb_random_t and rb_random_mt_t for
  Mersenne Twister implementation.

* include/ruby/random.h: the interface for extensions of Random
  class.

* DLL imported symbol reference is not constant on Windows.

* check if properly initialized.
2020-09-07 20:08:01 +09:00
Koichi Sasada 79df14c04b Introduce Ractor mechanism for parallel execution
This commit introduces Ractor mechanism to run Ruby program in
parallel. See doc/ractor.md for more details about Ractor.
See ticket [Feature #17100] to see the implementation details
and discussions.

[Feature #17100]

This commit does not complete the implementation. You can find
many bugs on using Ractor. Also the specification will be changed
so that this feature is experimental. You will see a warning when
you make the first Ractor with `Ractor.new`.

I hope this feature can help programmers from thread-safety issues.
2020-09-03 21:11:06 +09:00
Jeremy Evans d9b8411a7b Document that StringScanner#matched_size returns size in bytes [ci skip]
Fixes [Bug #17139]
2020-09-02 10:41:49 -07:00
Jeremy Evans cc5b7ed1dc Document limitation of Pathname#relative_path_from [ci skip]
This method is explicitly documented to not access the filesystem,
and the only way to get the correct behavior for a case where the
filesystem's case sensitivity differs from the operating system
default would be to access the filesystem.

Fixes [Bug #15417]
2020-09-02 10:34:33 -07:00
Sutou Kouhei c23c880f56
[ruby/strscan] Bump version
https://github.com/ruby/strscan/commit/df90d541fa
2020-08-31 21:57:35 +09:00
Nobuyoshi Nakada c76508b88c
[ruby/strscan] Replaced examples using $KCODE with encodings
`$KCODE` has been deprecated and not effective since years ago.

https://github.com/ruby/strscan/commit/7c4dbd4cb3
2020-08-31 21:57:35 +09:00
Masaki Matsushita 6d946665bd Show deprecation warning on Socket.gethostbyname and Socket.gethostbyaddr 2020-08-29 17:18:59 +09:00
Masaki Matsushita 9658a5a849 Show deprecation warning on TCPSocket.gethostbyname 2020-08-28 01:01:51 +09:00
Nobuyoshi Nakada 280d028125 [ruby/stringio] Bump version to 0.1.4
https://github.com/ruby/stringio/commit/64f2360d38
2020-08-27 23:55:17 +09:00
Yoann Lecuyer b3c1c767ea [stringio] fix stringio codepoint enumerator off by one error 2020-08-27 23:41:22 +09:00
Nobuyoshi Nakada 96d701f737
Adjust indents [ci skip] 2020-08-27 23:39:15 +09:00
卜部昌平 490010084e sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
Kir Shatrov 2038cc6cab
Make Socket.getaddrinfo interruptible (#2827)
Before, Socket.getaddrinfo was using a blocking getaddrinfo(3) call.
That didn't allow to wrap it into Timeout.timeout or interrupt the thread in any way.

Combined with the default 10 sec resolv timeout on many Unix systems, this can
have a very noticeable effect on production Ruby apps being not
resilient to DNS outages and timing out name resolution, and being unable to fail fast even
with Timeout.timeout.

Since we already have support for getaddrinfo_a(3), the async version
of getaddrinfo, we should be able to make Socket.getaddrinfo leverage that
when getaddrinfo_a version is available in the system (hence #ifdef
HAVE_GETADDRINFO_A).

Related tickets:
https://bugs.ruby-lang.org/issues/16476
https://bugs.ruby-lang.org/issues/16381
https://bugs.ruby-lang.org/issues/14997
2020-08-27 16:39:13 +09:00
卜部昌平 756403d775 sed -i '/r_cast.h/d' 2020-08-27 15:03:36 +09:00
卜部昌平 0da2a3f1fc sed -i '\,2/extern.h,d' 2020-08-27 14:07:49 +09:00
Hiroshi SHIBATA 2e3a7f70ae
Promote nkf to default gems 2020-08-25 21:17:19 +09:00
Jeremy Evans 9e25eb308d Update PTY.open documentation to document it yields a single argument [ci skip]
For a regular block, accepting two arguments is fine as the array
will be autosplatted.   However, a lambda that accepts two arguments
will not work.

We could change the implementation to yield two arguments instead
of an array with a single argument, but that would be less backwards
compatible.

I'm only changing the call-seq to be precise, other examples pass
a literal block that accepts two arguments, and I left those alone
as that will be the most common usage.

Fixes [Bug #17094]
2020-08-24 16:09:22 -07:00
卜部昌平 80b316212a ext/-test-/cxxanyargs: suppress SunPro warning
I found a way to suppress particular kind of warnings via pragmas.
2020-08-21 11:04:54 +09:00
Jean Boussier a74df67244 Fix ObjectSpace.trace_object_allocations_stop to not raise if the tracepoint were not initialized 2020-08-19 08:13:09 -07:00
卜部昌平 99093e1600 RHASH_TBL: is now ext-only
It seems almost no internal codes use RHASH_TBL any longer.  Why not
just eliminate it entirely, so that the macro can be purely ext-only.
2020-08-19 15:10:53 +09:00
Aaron Patterson 7a58ee9b96 Update references when tracing allocations
The allocation tracing code keeps essentially a weak reference to
objects that have been allocated (storing the allocation information
along with the weak ref).  Compacting the heap would break references in
this weak map, so the wrong values could be returned.

This commit just updates the values in the weak ref in order to fix the
allocation tracing book keeping
2020-08-18 19:10:51 -07:00
Hiroshi SHIBATA d3b2c1a175
Fixed the invalid SPDX identifier on gemspec 2020-08-18 20:26:40 +09:00
Hiroshi SHIBATA 8fb02b7a97
Update the license for the default gems to dual licenses 2020-08-18 20:26:39 +09:00
Hiroshi SHIBATA a114869905
Fixed the attribute name for multiple licenses. 2020-08-18 20:26:39 +09:00
John Hawthorn 971857c332 Fix method name escaping in ObjectSpace.dump
It's possible to define methods with any name, even if the parser
doesn't support it and it can only be used with ex. send.

This fixes an issue where invalid JSON was output from ObjectSpace.dump
when a method name needed escaping.
2020-08-17 09:47:53 -07:00
Nobuyoshi Nakada 27f7b047e0
Also escape DEL code 2020-08-17 22:36:48 +09:00
Nobuyoshi Nakada 7b4b5e0840
Fixed the radix for control chars 2020-08-17 22:30:26 +09:00
Marc-Andre Lafortune 352895b751 [ruby/racc] Return `nil` for all syntax errors
https://github.com/ruby/racc/commit/51817ce0f6
2020-07-30 10:07:06 -04:00
Hiroshi SHIBATA 2bd1f827f1
Promote io-nonblock to the default gems. 2020-07-30 21:21:08 +09:00
Hiroshi SHIBATA d75b42a70a
Promote io-wait to the default gems 2020-07-30 21:10:28 +09:00
Kazuhiro NISHIYAMA 946cd6c534
Use https instead of http 2020-07-28 19:51:54 +09:00
Simon Perepelitsa 09e9f7cf7a [DOC] Clarify ObjectSpace return values are in bytes [ci skip] 2020-07-28 12:13:40 +09:00
Jean Boussier 6a0cb1d649 Avoid allocating a string when dumping an anonymous module or class 2020-07-23 10:52:30 +09:00
Nobuyoshi Nakada 16daee1c75 [ruby/stringio] Bump version to 0.1.3
https://github.com/ruby/stringio/commit/376516cd2d
2020-07-20 14:59:19 +09:00
Nobuyoshi Nakada ddb2acbba6 [ruby/stringio] No compatibility check in US-ASCII case
https://github.com/ruby/stringio/commit/59df1c8293
2020-07-20 14:59:19 +09:00
Nobuyoshi Nakada a7c67fc6da [ruby/stringio] Removed wrong UNREACHABLE
https://github.com/ruby/stringio/commit/f528538d10
2020-07-20 14:59:19 +09:00
Nobuyoshi Nakada 574871781b [ruby/stringio] Bump version to 0.1.2
https://github.com/ruby/stringio/commit/8cbe3f7397
2020-07-20 14:59:19 +09:00
Nobuyoshi Nakada 6ff9604f85 [ruby/stringio] Raise an error if encoding conversion not succeeded
As `rb_str_conv_enc()` returns the argument string object itself
unchanged when any conversion failed, check the incompatibility in
that case.

Fixes https://github.com/ruby/stringio/issues/13

https://github.com/ruby/stringio/commit/ede6bdcc71
2020-07-20 14:59:19 +09:00
Nobuyoshi Nakada d2bf6133f6
Remove trailing spaces [ci skip] 2020-07-20 13:34:16 +09:00
Masataka Pocke Kuwabara 8d2333019a Fix MonitorMixin when the super's initialize has kwargs 2020-07-17 16:37:18 -07:00