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

8217 Коммитов

Автор SHA1 Сообщение Дата
Sutou Kouhei ab5212b3c9 [ruby/fiddle] Add support for "const" in type
GitHub: fix #68

Reported by kojix2. Thanks!!!

https://github.com/ruby/fiddle/commit/d7322c234a
2021-05-18 12:48:40 +09:00
Sutou Kouhei 4d1bb460f6 [ruby/fiddle] Add --enable-debug-build option to extconf.rb
https://github.com/ruby/fiddle/commit/e0498e60ea
2021-05-18 12:48:40 +09:00
Sutou Kouhei 791e8eec66 [ruby/fiddle] win32types: sort
https://github.com/ruby/fiddle/commit/35dec6c5a5
2021-05-18 12:48:40 +09:00
Sutou Kouhei 8758b07b1e [ruby/fiddle] Fix more Win32Types definitions
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types

https://github.com/ruby/fiddle/commit/805c1a595a
2021-05-18 12:48:40 +09:00
Orgad Shaneh 25e56fe374 [ruby/fiddle] Fix Win32Types for Windows 64-bit (#63)
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types

https://github.com/ruby/fiddle/commit/28ee5b1608
2021-05-18 12:48:40 +09:00
Sutou Kouhei 8d63b1dc75 [ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/0cbd370fd6
2021-05-18 12:48:40 +09:00
Sutou Kouhei 881b2dc898 [ruby/fiddle] closure: add support for const char *
GitHub: fix GH-62

Reported by Cody Krieger. Thanks!!!

https://github.com/ruby/fiddle/commit/284b820f2d
2021-05-18 12:48:40 +09:00
Sutou Kouhei b2de5999d8 [ruby/fiddle] closure: accept symbol as type
https://github.com/ruby/fiddle/commit/dc2da6633e
2021-05-18 12:48:40 +09:00
Sutou Kouhei 212d836cd7 [ruby/fiddle] Remove wrong comment
https://github.com/ruby/fiddle/commit/831522e768
2021-05-18 12:48:40 +09:00
Kenta Murata 7bd3d6d23e [ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/63e5f98412
2021-05-18 12:48:40 +09:00
Hiroshi SHIBATA ee611341c9
Bump version of required_ruby_version to 2.3. Fixes #464 2021-05-17 19:51:51 +09:00
Jean Boussier 2de594ca98
[flori/json] Deduplicate strings inside json_string_unescape
[ci 2]

https://github.com/flori/json/commit/1982070cb8
2021-05-17 19:51:51 +09:00
Jean Boussier 1d2b4ccaf2
[flori/json] Refactor json_string_unescape
https://github.com/flori/json/commit/f398769332
2021-05-17 19:51:50 +09:00
Masafumi Koba 8a974dc83c [flori/json] Fix incorrect `#` position in API doc
This change fixes an incorrect `#` position in the API documentation of the `JSON` module.

https://github.com/flori/json/commit/dc4b62424f
2021-05-17 19:26:03 +09:00
Aaron Patterson 42b20bdbfe
[ruby/psych] remove deprecated interface
https://github.com/ruby/psych/commit/0767227051
2021-05-17 11:20:46 +09:00
Aaron Patterson b0e21197ce
[ruby/psych] Bump version
https://github.com/ruby/psych/commit/1df86a2e81
2021-05-17 11:20:46 +09:00
Aaron Patterson fbb4e3f96c
[ruby/psych] Use Psych.safe_load by default
Psych.load is not safe for use with untrusted data.  Too many
applications make the mistake of using `Psych.load` with untrusted data
and that ends up with some kind of security vulnerability.

This commit changes the default `Psych.load` to use `safe_load`.  Users
that want to parse trusted data can use Psych.unsafe_load.

https://github.com/ruby/psych/commit/176494297f
2021-05-17 11:20:45 +09:00
Aaron Patterson c7c2ad5749
[ruby/psych] Introduce `Psych.unsafe_load`
In future versions of Psych, the `load` method will be mostly the same
as the `safe_load` method.  In other words, the `load` method won't
allow arbitrary object deserialization (which can be used to escalate to
an RCE).  People that need to load *trusted* documents can use the
`unsafe_load` method.

This commit introduces the `unsafe_load` method so that people can
incrementally upgrade.  For example, if they try to upgrade to 4.0.0 and
something breaks, they can downgrade, audit callsites, change to
`safe_load` or `unsafe_load` as required, and then upgrade to 4.0.0
smoothly.

https://github.com/ruby/psych/commit/cb50aa8d3f
2021-05-17 11:20:45 +09:00
Jean Boussier a3ceed50b8
[ruby/psych] Fix symabolize_name with non-string keys
https://github.com/ruby/psych/commit/1c5c29e81f
2021-05-17 11:20:45 +09:00
Jeremy Ebler 830778db95
[ruby/psych] feat: allow scalars and sequences to be styled when dumped
https://github.com/ruby/psych/commit/546154ddb7
2021-05-17 11:20:45 +09:00
Yusuke Endoh f691c15792 ext/objspace/lib/objspace/trace.rb: Remove the original Kernel#p
... to disable a "method redefined" warning.

http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20210514T050008Z.fail.html.gz
```
  1) Failure:
TestObjSpace#test_objspace_trace [/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/test/objspace/test_objspace.rb:621]:
<["objspace/trace is enabled"]> expected but was
<["/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/.ext/common/objspace/trace.rb:29: warning: method redefined; discarding old p",
 "objspace/trace is enabled"]>.
```
2021-05-14 15:39:57 +09:00
Yusuke Endoh cf1e1879f1 ext/objspace/lib/objspace/trace.rb: Added
This file, when require'ed, starts tracing the object allocations, and
redefines `Kernel#p` to show the allocation site.

This commit is experimental; the library name and APIs may change.

[Feature #17762]
2021-05-14 13:40:32 +09:00
Ryuta Kamizono 73136ebbde
[ruby/psych] Fix some typos [ci skip]
https://github.com/ruby/psych/commit/98617e55a1
2021-05-10 19:19:35 +09:00
Aaron Patterson b7250026dd
[ruby/psych] bump version
https://github.com/ruby/psych/commit/091cd46b1f
2021-05-10 19:19:35 +09:00
Tim Gates 954970162c
[ruby/psych] docs: fix simple typo, expessed -> expressed
There is a small typo in ext/psych/yaml/yaml.h.

Should read `expressed` rather than `expessed`.

https://github.com/ruby/psych/commit/1150d669cb
2021-05-10 19:19:35 +09:00
Charles Oliver Nutter 1563de5997
[ruby/psych] Update to latest SnakeYAML
Fixes jruby/jruby#6365

https://github.com/ruby/psych/commit/a88ff77f02
2021-05-10 19:19:35 +09:00
Jean Boussier c110ade0d2
[ruby/psych] Fix custom marshalization with symbolize_names: true
https://github.com/ruby/psych/commit/ee26f26ab5
2021-05-10 19:17:32 +09:00
Jean Boussier 155cd7fd2a
[ruby/psych] Cache dispatch cache in an instance variable
https://github.com/ruby/psych/commit/285c461cd2
2021-05-10 19:17:32 +09:00
Jean Boussier 3ab41acd36
[ruby/psych] Cache access to Psych.load_tags in Visitor::ToRuby
https://github.com/ruby/psych/commit/58223f0426
2021-05-10 19:17:32 +09:00
Matt Valentine-House 8bbd319806 Allow newobj_of0 and newobj_slowpath to allocate into multiple heap slots 2021-05-06 09:18:17 -04:00
Gannon McGibbon a42b7de436 [ruby/strscan] Replace "iff" with "if and only if" (#18)
iff means if and only if, but readers without that knowledge might
assume this to be a spelling mistake. To me, this seems like
exclusionary language that is unnecessary. Simply using "if and only if"
instead should suffice.

https://github.com/ruby/strscan/commit/066451c11e
2021-05-06 16:21:14 +09:00
Kenichi Kamiya 564ccd095a [ruby/strscan] Fix segmentation fault of `StringScanner#charpos` when `String#byteslice` returns non string value [Bug #17756] (#20)
https://github.com/ruby/strscan/commit/92961cde2b
2021-05-06 16:20:38 +09:00
Hiroshi SHIBATA 822eb94563
Import from https://github.com/ruby/strscan/pull/19
* Use Gemfile instead of Gem::Specification#add_development_dependency.

* Use pend instead of skip for test-unit.
2021-05-06 16:18:58 +09:00
Benoit Daloze 0764d323d8 Fix -Wundef warnings for patterns `#if HAVE`
* See [Feature #17752]
* Using this to detect them:
  git grep -P 'if\s+HAVE' | grep -Pv 'HAVE_LONG_LONG|/ChangeLog|HAVE_TYPEOF'
2021-05-04 14:56:55 +02:00
Benoit Daloze fa7a712d46 Fix -Wundef warnings for HAVE_RB_EXT_RACTOR_SAFE
* See [Feature #17752]
2021-05-04 14:56:55 +02:00
Benoit Daloze 59a92a84c8 Fix -Wundef warnings in core extensions
* See [Feature #17752]
2021-05-04 14:56:55 +02:00
Nobuyoshi Nakada 96fd1e1f22
Removed unused macro HAVE_CONFIG_H
It seems like a vestige of ext/md5.
2021-04-28 18:48:08 +09:00
Nobuyoshi Nakada 795fb51f80
NDEBUG is ignored since Ruby 3.0 2021-04-28 18:48:08 +09:00
Benoit Daloze 3a3b19b2bb Fix Monitor to lock per Fiber, like Mutex [Bug #17827] 2021-04-27 18:42:50 +02:00
Lars Kanis 22d36c463f [ruby/gdbm] Add dependency to gdbm package on mingw
RubyInstaller2 supports metadata tags for installation of dependent
MSYS2/MINGW libraries. The openssl gem requires the mingw-openssl
package to be installed on the system, which the gem installer takes
care about, when this tag is set.

The feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

Fixes https://github.com/oneclick/rubyinstaller2/issues/163

https://github.com/ruby/gdbm/commit/d95eed3e86
2021-04-27 20:54:07 +09:00
Olle Jonsson ad3f4c07d9 [ruby/pathname] gemspec: Explicitly list 0 executables
This gem exposes no executables.

https://github.com/ruby/pathname/commit/c401d97d58
2021-04-27 20:52:48 +09:00
Peter Zhu 4f88acc833 Fix compiler warnings in objspace_dump.c when assertions are turned on
Example:

```
In file included from ../../../include/ruby/defines.h:72,
                 from ../../../include/ruby/ruby.h:23,
                 from ../../../gc.h:3,
                 from ../../../ext/objspace/objspace_dump.c:15:
../../../ext/objspace/objspace_dump.c: In function ‘dump_append_ld’:
../../../ext/objspace/objspace_dump.c:95:26: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘int’ [-Wsign-compare]
   95 |     RUBY_ASSERT(required <= width);
      |                          ^~
```
2021-04-26 19:26:50 -04:00
Ryuta Kamizono 33f2ff3bab Fix some typos by spell checker 2021-04-26 10:07:41 +09:00
wonda-tea-coffee f9b62b5cc0 [Doc] Fix a typo s/algorthm/algorithm/ 2021-04-25 10:52:29 -04:00
wonda-tea-coffee ca5816e275 [ci skip] Fix a typo s/certificiate/certificate/ 2021-04-25 10:51:45 -04:00
wonda-tea-coffee 04e6383f40 [Doc] Fix a typo s/daguten/dakuten/ 2021-04-25 10:51:23 -04:00
wonda-tea-coffee 532c775e22 [Doc] Fix a typo s/arround/around/ 2021-04-25 10:50:12 -04:00
Charles Oliver Nutter 270b16e70c
[ruby/io-console] Move FFI console under lib
Having the separate dir makes testing difficult and doesn't
reflect the structure the gem will eventually have. We can filter
these files out if necessary when building the CRuby gem.

https://github.com/ruby/io-console/commit/881010447c
2021-04-22 11:53:13 +09:00
Duncan MacGregor 042860bd65
[ruby/io-console] Enable building the C extension on TruffleRuby.
https://github.com/ruby/io-console/commit/c17b8cf3a9
2021-04-22 11:51:37 +09:00
Olle Jonsson 4ac72d37d7 [ruby/io-wait] gemspec: Explicitly list 0 executables
This gem exposes no executables, and this clarifies this.

https://github.com/ruby/io-wait/commit/f491c6cc64
2021-04-21 20:38:00 +09:00
Olle Jonsson 59411b0b36
[ruby/zlib] gemspec: Remove unused files
Remove the list of executables.

https://github.com/ruby/zlib/commit/6a70725b8e
2021-04-20 21:19:41 +09:00
Olle Jonsson 749aad280f
[ruby/gdbm] gemspec: Set executables to the empty list
This gem exposes zero executables.

https://github.com/ruby/gdbm/commit/d51cf47f65
2021-04-20 21:19:41 +09:00
Olle Jonsson cc8d0e7cbf
[ruby/dbm] gemspec: add README & LICENSE
https://github.com/ruby/dbm/commit/c86b94b781
2021-04-20 21:19:41 +09:00
Hiroshi SHIBATA 3fdc58c08b
[ruby/date] Bump version to 3.1.1
https://github.com/ruby/date/commit/e574cc9048
2021-04-20 20:46:03 +09:00
卜部昌平 6413dc27dc dependency updates 2021-04-13 14:30:21 +09:00
Tom Stuart 8b2f2a707d [ruby/openssl] Use #ifdef consistently for HAVE_RB_EXT_RACTOR_SAFE
We previously used a mix of both `#if` and `#ifdef`, but the latter is
more reliable because it will still work if the macro is undefined.

https://github.com/ruby/openssl/commit/e4a622e67e
2021-03-31 18:05:08 +09:00
Tom Stuart 5ab2625243 [ruby/openssl] Fix OpenSSL::Engine build on Debian
On Debian 9 (“stretch”) the `OPENSSL_NO_STATIC_ENGINE` macro is not
defined, which causes all the `#if HAVE_ENGINE_LOAD_…` directives to
fail with `error: 'HAVE_ENGINE_LOAD_…' is not defined, evaluates to 0
[-Werror,-Wundef]` while building TruffleRuby.

We can accomplish the same thing with `#ifdef`, which (of course) works
fine when the `HAVE_ENGINE_LOAD…` macros are also undefined.

Upstreamed from oracle/truffleruby#2255, which fixed
oracle/truffleruby#2254.

https://github.com/ruby/openssl/commit/65e2adf1ac
2021-03-31 18:05:08 +09:00
Kazuki Yamaguchi e2bf3659e1 [ruby/openssl] pkcs7: keep private key when duplicating PKCS7_SIGNER_INFO
ASN1_dup() will not copy the 'pkey' field of a PKCS7_SIGNER_INFO object
by design; it is a temporary field kept until the PKCS7 structure is
finalized. Let's bump reference counter of the pkey in the original
object and use it in the new object, too.

This commit also removes PKCS7#add_signer's routine to add the
content-type attribute as a signed attribute automatically. This
behavior was not documented or tested. This change should not break any
working user code since the method was completely useless without the
change above.

https://github.com/ruby/openssl/commit/20ca7a27a8
2021-03-31 18:05:07 +09:00
aycabta 66d2fc7989 Enclose the code that was accidentally a link in "tt" 2021-03-31 15:18:52 +09:00
Nobuyoshi Nakada 94d564077c
Text files should end with a newline 2021-03-30 23:41:21 +09:00
Nobuyoshi Nakada 989e22f394
[ruby/io-console] bump up to 0.5.9
https://github.com/ruby/io-console/commit/302e86a28c
https://github.com/ruby/io-console/commit/0690862526
2021-03-28 23:42:38 +09:00
Kenichi Kamiya 9af57eeed6
[ruby/pathname] Fix segfault of Pathname#split
Fix segmentation fault of Pathname#split when File.split returns
non array value [Bug #17755]

https://github.com/ruby/pathname/commit/e29b49e3b1
https://github.com/ruby/pathname/commit/1db7479a74
2021-03-28 14:04:10 +09:00
Jean Boussier 7e8a9af9db rb_enc_interned_str: handle autoloaded encodings
If called with an autoloaded encoding that was not yet
initialized, `rb_enc_interned_str` would crash with
a NULL pointer exception.

See: https://github.com/ruby/ruby/pull/4119#issuecomment-800189841
2021-03-22 21:37:48 +09:00
Nobuyoshi Nakada 3260602fa3
Adjusted indents [ci skip] 2021-03-17 09:49:17 +09:00
Sorah Fukumori cf831f4918
zlib: fix Gzip{Writer,Reader}.new fails with a O_TMPFILE file 2021-03-17 02:16:27 +09:00
Kazuki Yamaguchi 1eb6d8aa63 [ruby/openssl] bn: check -1 return from BIGNUM functions
Although the manpage says that BIGNUM functions return 0 on error,
OpenSSL versions before 1.0.2n and current LibreSSL versions may return
-1 instead.

Note that the implementation of OpenSSL::BN#mod_inverse is extracted
from BIGNUM_2c() macro as it didn't really share the same function
signature with others.

https://github.com/ruby/openssl/commit/9b59f34345
2021-03-16 19:37:06 +09:00
Nobuyoshi Nakada 1ad2224773 [ruby/openssl] Fixed the results of OpenSSL::Timestamp::Response#failure_info
Made stored values `Symbol`s instead of `ID`s.

Fixes https://bugs.ruby-lang.org/issues/17625

Co-Authored-By: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>

https://github.com/ruby/openssl/commit/f2d004679a
2021-03-16 19:37:06 +09:00
Jeremy Evans e2ce383044 [ruby/openssl] Enhance TLS 1.3 support on LibreSSL 3.2/3.3
This defines TLS1_3_VERSION when using LibreSSL 3.2+.  LibreSSL 3.2/3.3
doesn't advertise this by default, even though it will use TLS 1.3
in both client and server modes.

Changes between LibreSSL 3.1 and 3.2/3.3 broke a few tests, Defining
TLS1_3_VERSION by itself fixes 1 test failure.  A few tests now
fail on LibreSSL 3.2/3.3 unless TLS 1.2 is set as the maximum version,
and this adjusts those tests.  The client CA test doesn't work in
LibreSSL 3.2+, so I've marked that as pending.

For the hostname verification, LibreSSL 3.2.2+ has a new stricter
hostname verifier that doesn't like subjectAltName such as
c*.example.com and d.*.example.com, so adjust the related tests.

With these changes, the tests pass on LibreSSL 3.2/3.3.

https://github.com/ruby/openssl/commit/a0e98d48c9
2021-03-16 19:37:06 +09:00
Kazuki Yamaguchi 4756ac00b7 [ruby/openssl] pkey/ec: remove OpenSSL::PKey::EC::Group.new(ec_method) form
The form created an empty EC_GROUP object with the specified EC_METHOD.
However, the feature was unfinished and not useful in any way because
OpenSSL::PKey::EC::Group did not implement wrappers for necessary
functions to set actual parameters for the group, namely
EC_GROUP_set_curve() family.

EC_GROUP object creation with EC_METHOD explicitly specified is
deprecated in OpenSSL 3.0, as it was apparently not intended for use
outside OpenSSL.

It is still possible to create EC_GROUP, but without EC_METHOD
explicitly specified - OpenSSL chooses the appropriate EC_METHOD for
the curve type. The OpenSSL::PKey::EC::Group.new(<:GFp|:GF2m>, p, a, b)
form will continue to work.

https://github.com/ruby/openssl/commit/df4bec841f
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi d47210b113 [ruby/openssl] ssl: remove SSL::SSLContext#tmp_ecdh_callback
The underlying API SSL_CTX_set_tmp_ecdh_callback() was removed by
LibreSSL >= 2.6.1 and OpenSSL >= 1.1.0, in other words, it is not
supported by any non-EOL versions of OpenSSL.

The wrapper was initially implemented in Ruby 2.3 and has been
deprecated since Ruby/OpenSSL 2.0 (bundled with Ruby 2.4) with explicit
warning with rb_warn().

https://github.com/ruby/openssl/commit/ee037e1460
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 945ed40862 [ruby/openssl] ssl: retry write on EPROTOTYPE on macOS
Errno::EPROTOTYPE is not supposed to be raised by SSLSocket#write.
However, on macOS, send(2) which is called via SSL_write() can
occasionally return EPROTOTYPE. Retry SSL_write() so that we get a
proper error, just as ext/socket does.

Reference: https://bugs.ruby-lang.org/issues/14713
Reference: https://github.com/ruby/openssl/issues/227

https://github.com/ruby/openssl/commit/2e700c80bf
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi c46b1f0bec [ruby/openssl] x509store: update rdoc for X509::Store and X509::StoreContext
Add more details about each method, and add reference to OpenSSL man
pages.

https://github.com/ruby/openssl/commit/02b6f82c73
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 62d889c857 [ruby/openssl] x509store: fix memory leak in X509::StoreContext.new
The certificate passed as the second argument was not properly free'd
in the error paths.

https://github.com/ruby/openssl/commit/9561199b9f
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 871c61d5d0 [ruby/openssl] x509store: avoid ossl_raise() calls with NULL message
Use the OpenSSL function name that caused the error to generate a better
error message.

https://github.com/ruby/openssl/commit/b31809ba3d
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi be3ba2ee4d [ruby/openssl] x509store: refactor X509::StoreContext#chain
Use ossl_x509_sk2ary() to create an array of OpenSSL::X509::Certificate
from STACK_OF(X509).

https://github.com/ruby/openssl/commit/fa1da69f92
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 08c99a4208 [ruby/openssl] x509store: emit warning if arguments are given to X509::Store.new
Anything passed to OpenSSL::X509::Store.new was always ignored. Let's
emit an explicit warning to not confuse users.

https://github.com/ruby/openssl/commit/d173700eeb
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 88b8b3ac15 [ruby/openssl] x509store: let X509::Store#add_file raise TypeError if nil is given
Undo special treatment of nil and simply pass the value to
StringValueCStr().

nil was never a valid argument for the method; OpenSSL::X509::StoreError
with an unhelpful error message "system lib" was raised in that case.

https://github.com/ruby/openssl/commit/fb2fcbb137
2021-03-16 19:16:11 +09:00
Nobuhiro IMAI 92f19f7bb0 [ruby/openssl] [DOC] Fix RDoc markup
https://github.com/ruby/openssl/commit/f36af95519
2021-03-16 19:16:11 +09:00
Claus Lensbøl be1e88a277 [ruby/openssl] Fix typo in documentation
The socket is called ssl_connection, not connection

https://github.com/ruby/openssl/commit/642783aeda
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 81325db5f8 [ruby/openssl] ssl: initialize verify_mode and verify_hostname with default values
SSLContext's verify_mode expects an SSL_VERIFY_* constant (an integer)
and verify_hostname expects either true or false. However, they are set
to nil after calling OpenSSL::SSL::SSLContext.new, which is surprising.

Set a proper value to them by default: verify_mode is set to
OpenSSL::SSL::VERIFY_NONE and verify_hostname is set to false by
default.

Note that this does not change the default behavior. The certificate
verification was never performed unless verify_mode is set to
OpenSSL::SSL::VERIFY_PEER by a user. The same applies to
verify_hostname.

https://github.com/ruby/openssl/commit/87d869352c
2021-03-16 19:16:11 +09:00
Colton Jenkins c71afc9db7 [ruby/openssl] Add compare? method to OpenSSL::PKey that wraps EVP_PKEY_cmp.
Explicitly check for type given some conflicting statements within openssl's
documentation around EVP_PKEY_cmp and EVP_PKEY_ASN1_METHOD(3).
Add documentation with an example for compare?

https://github.com/ruby/openssl/commit/0bf51da6e2
2021-03-16 19:16:11 +09:00
Bart de Water da6341b709 [ruby/openssl] User lower case cipher names for maximum compatibility
We ran into some Linux-based systems not accepting the upper case variant

https://github.com/ruby/openssl/commit/7bc49121d5
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 13198d4968 [ruby/openssl] hmac: implement base64digest methods
OpenSSL::HMAC implements the similar interface as ::Digest. Let's add
base64digest methods to OpenSSL::HMAC, too, for feature parity.

https://github.com/ruby/openssl/commit/098bcb68af
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi b91f62f384 [ruby/openssl] hmac: migrate from the low-level HMAC API to the EVP API
Use the EVP API instead of the low-level HMAC API. Use of the HMAC API
has been discouraged and is being marked as deprecated starting from
OpenSSL 3.0.0.

The two singleton methods OpenSSL::HMAC, HMAC.digest and HMAC.hexdigest
are now in lib/openssl/hmac.rb.

https://github.com/ruby/openssl/commit/0317e2fc02
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi fde9f806cb [ruby/openssl] pkey/ec: deprecate OpenSSL::PKey::EC::Point#mul(ary, ary [, bn])
Deprecate it for future removal. However, I do not expect any
application is affected by this.

The other form of calling it, PKey::EC::Point#mul(bn [, bn]) remains
untouched.

PKey::EC::Point#mul calls EC_POINTs_mul(3) when multiple BNs
are given as an array. LibreSSL 2.8.0 released on 2018-08 removed the
feature and OpenSSL 3.0 which is planned to be released in 2020 will
also deprecate the function as there is no real use-case.

https://github.com/ruby/openssl/commit/812de4253d
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 15863069c9 [ruby/openssl] digest, hmac, ts, x509: use IO.binread in examples where appropriate
IO.read may mangle line separator, which will corrupt binary data
including DER-encoded X.509 certificates and such.

Fixes: https://github.com/ruby/openssl/issues/243

https://github.com/ruby/openssl/commit/93213b2730
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 9d3ffe09c4 [ruby/openssl] pkey: reimplement PKey::DH#compute_key and PKey::EC#dh_compute_key
Use the new OpenSSL::PKey::PKey#derive instead of the raw
{EC,}DH_compute_key(), mainly to reduce amount of the C code.

https://github.com/ruby/openssl/commit/28edf6bafc
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi fbadb01d6e [ruby/openssl] pkey: add PKey::PKey#derive
Add OpenSSL::PKey::PKey#derive as the wrapper for EVP_PKEY_CTX_derive().
This is useful for pkey types that we don't have dedicated classes, such
as X25519.

https://github.com/ruby/openssl/commit/28f0059bea
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi b2dc4880f5 [ruby/openssl] pkey: support 'one-shot' signing and verification
OpenSSL 1.1.1 added EVP_DigestSign() and EVP_DigestVerify() functions
to the interface. Some EVP_PKEY methods such as PureEdDSA algorithms
do not support the streaming mechanism and require us to use them.

https://github.com/ruby/openssl/commit/ae19454592
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 5cae289682 [ruby/openssl] pkey: port PKey::PKey#sign and #verify to the EVP_Digest* interface
Use EVP_DigestSign*() and EVP_DigestVerify*() interface instead of the
old EVP_Sign*() and EVP_Verify*() functions. They were added in OpenSSL
1.0.0.

Also, allow the digest to be specified as nil, as certain EVP_PKEY types
don't expect a digest algorithm.

https://github.com/ruby/openssl/commit/9ff6e5143b
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 1e3590fe22 [ruby/openssl] pkey: add PKey.generate_parameters and .generate_key
Add two methods to create a PKey using the generic EVP interface. This
is useful for the PKey types we don't have a dedicated class.

https://github.com/ruby/openssl/commit/d8e8e57de9
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 498c8e8f17 [ruby/openssl] pkey: assume generic PKeys contain private components
The EVP interface cannot tell whether if a pkey contains the private
components or not. Assume it does if it does not respond to #private?.
This fixes the NoMethodError on calling #sign on a generic PKey.

https://github.com/ruby/openssl/commit/f4c717bcb2
2021-03-16 19:16:11 +09:00
Kazuki Yamaguchi 1f44640677 [ruby/openssl] pkey: refactor #export/#to_pem and #to_der
Add ossl_pkey_export_traditional() and ossl_pkey_export_spki() helper
functions, and use them. This reduces code duplication.

https://github.com/ruby/openssl/commit/56f0d34d63
2021-03-16 19:16:10 +09:00
Kazuki Yamaguchi 707e3d49cb [ruby/openssl] pkey: refactor DER/PEM-encoded string parsing code
Export the flow used by OpenSSL::PKey.read and let the subclasses call
it before attempting other formats.

https://github.com/ruby/openssl/commit/d963d4e276
2021-03-16 19:16:10 +09:00
Kazuki Yamaguchi 10d360847b [ruby/openssl] pkey: prefer PKey.read over PKey::RSA.new in docs
https://github.com/ruby/openssl/commit/cf92a3ffba
2021-03-16 19:16:10 +09:00
Kazuki Yamaguchi efad0166c6 [ruby/openssl] pkey: have PKey.read parse PEM-encoded DHParameter
Try PEM_read_bio_Parameters(). Only PEM format is supported at the
moment since corresponding d2i_* functions are not provided by OpenSSL.

https://github.com/ruby/openssl/commit/867e5c021b
2021-03-16 19:16:10 +09:00
Kazuki Yamaguchi c157f6e787 [ruby/openssl] pkey: inline {rsa,dsa,dh,ec}_instance()
Merge the code into the callers so that the wrapping Ruby object is
allocated before the raw key object is allocated. This prevents possible
memory leak on Ruby object allocation failure, and also reduces the
lines of code.

https://github.com/ruby/openssl/commit/1eb1366615
2021-03-16 19:16:10 +09:00
Kazuki Yamaguchi 27859c09a6 [ruby/openssl] pkey: simplify ossl_pkey_new()
ossl_{rsa,dsa,dh,ec}_new() called from this function are not used
anywhere else. Inline them into pkey_new0() and reduce code
duplication.

https://github.com/ruby/openssl/commit/94aeab2f26
2021-03-16 19:16:10 +09:00
Kazuki Yamaguchi 10289e9f22 [ruby/openssl] config: replace DupConfigPtr() with GetConfig()
Now that OpenSSL::Config wraps a real CONF object, the caller can just
borrow it rather than creating a new temporary CONF object. CONF object
is usually treated as immutable.

DupConfigPtr() is now removed, and GetConfig() is exported instead.

https://github.com/ruby/openssl/commit/d9064190ca
2021-03-16 19:16:10 +09:00
Kazuki Yamaguchi 22aeb6373e [ruby/openssl] config: revert to C implementation of OpenSSL::Config
Revert OpenSSL::Config to using the OpenSSL API and remove our own
parser implementation for the config file syntax.

OpenSSL::Config now wraps a CONF object. Accessor methods deal with the
object directly rather than Ruby-level internal state.

This work is based on the old C code we used before 2010.

https://github.com/ruby/openssl/commit/c891e0ea89
2021-03-16 19:16:10 +09:00
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