summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2025-07-01[ruby/json] Refactor simd/conf.rb - unnecessary `have_type`Nobuyoshi Nakada
Remove `have_type` calls because the next `try_compile` calls check those types. https://github.com/ruby/json/commit/b08e1ca2c1
2025-07-01[ruby/json] Refactor simd/conf.rb - conditions to enableNobuyoshi Nakada
See the results of `have_type` and `try_compile` in addition to `have_header` for NEON as well as x86_64. The former results were just ignored, and `HAVE_TYPE_` macros are unused too. https://github.com/ruby/json/commit/fdbb6062c2
2025-07-01[ruby/json] Refactor simd/conf.rb - balanceNobuyoshi Nakada
Align code for arm and x86_64 in parallel. https://github.com/ruby/json/commit/2211e30a59
2025-07-01[ruby/json] Refactor simd/conf.rb - compiler warningsNobuyoshi Nakada
Suppress warnings for old style function definition and unused variable. https://github.com/ruby/json/commit/58dc0aa938
2025-07-01[ruby/json] Use `load` simd/conf.rbNobuyoshi Nakada
When both extconf.rb of generator and parser are run in one process, the second `require_relative` does nothing. https://github.com/ruby/json/commit/8e775320b7
2025-07-01Use Dir.glob and base keyword arg for the installer of Ruby packageHiroshi SHIBATA
2025-07-01[ruby/json] Remove trailing spaces [ci skip]Nobuyoshi Nakada
https://github.com/ruby/json/commit/68ee9cf188
2025-06-30ruby tool/update-deps --fixHiroshi SHIBATA
2025-06-30Adjust ruby/ruby directory structureHiroshi SHIBATA
2025-06-30[ruby/json] Reduce duplication in extconf.rbJean Boussier
https://github.com/ruby/json/commit/3ae3eeb9d3
2025-06-30Optimize 'json_parse_string' using SIMD.Scott Myron
2025-06-25[ruby/openssl] pkey: use EVP_PKEY_new_raw_{private,public}_key_ex() if availableKazuki Yamaguchi
Algorithms implemented only in OpenSSL 3 providers may not have a corresponding NID. The *_ex() variants have been added in OpenSSL 3.0 to handle such algorithms, by taking algorithm names as a string. https://github.com/ruby/openssl/commit/e730e457cc
2025-06-25[ruby/openssl] pkey: handle EVP_PKEY_KEYMGMT return by EVP_PKEY_id()Kazuki Yamaguchi
For algorithms implemented solely in an OpenSSL 3 provider, without an associated EVP_PKEY_METHOD, EVP_PKEY_id() returns a special value EVP_PKEY_KEYMGMT. Let OpenSSL::PKey::PKey#oid raise an exception as necessary. Update PKey#inspect to include the string returned by EVP_PKEY_get0_type_name(), if available. https://github.com/ruby/openssl/commit/bd3e32270e
2025-06-25[ruby/openssl] ossl.h: include <openssl/provider.h> in ossl.hKazuki Yamaguchi
Move the #include from ossl_provider.c to ossl.h. As OpenSSL 3 provider functions will be used in multiple source files, having it in the common header file is convenient. https://github.com/ruby/openssl/commit/f831bb66bc
2025-06-24[ruby/json] Remove trailing spaces [ci skip]Nobuyoshi Nakada
https://github.com/ruby/json/commit/6c41162522
2025-06-24[ruby/json] Deprecate duplicate keys in objectJean Boussier
There are few legitimate use cases for duplicate keys, and can in some case be exploited. Rather to always silently accept them, we should emit a warning, and in the future require to explictly allow them. https://github.com/ruby/json/commit/06f00a42e8
2025-06-24[ruby/json] Add missing parser options documentationJean Boussier
https://github.com/ruby/json/commit/eed753ffde
2025-06-20[ruby/openssl] ssl: add SSLContext#sigalgs= and #client_sigalgs=Kazuki Yamaguchi
Add methods for setting supported signature algorithms, corresponding to SSL_CTX_set1_sigalgs_list() and SSL_CTX_set1_client_sigalgs_list(), respectively. https://github.com/ruby/openssl/commit/6bbe58c492 Co-authored-by: Markus Jung <markus.jung@vivavis.com>
2025-06-20[ruby/openssl] ssl: update rdoc for SSLContext#ciphers= and #ciphersuites=Kazuki Yamaguchi
https://github.com/ruby/openssl/commit/54f22395e7
2025-06-20[ruby/openssl] ssl: correct array index type in build_cipher_string()Kazuki Yamaguchi
https://github.com/ruby/openssl/commit/9c9333c07d
2025-06-17Refactor generic fields to use `T_IMEMO/fields` objects.Jean Boussier
Followup: https://github.com/ruby/ruby/pull/13589 This simplify a lot of things, as we no longer need to manually manage the memory, we can use the Read-Copy-Update pattern and avoid numerous race conditions. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/13626
2025-06-17Rename `imemo_class_fields` -> `imemo_fields`Jean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/13626
2025-06-17[ruby/json] Fix a typoNobuyoshi Nakada
ruby/ruby#13636 https://github.com/ruby/json/commit/6fc2c4b6ab Co-Authored-By: Tim Smith <tsmith84@gmail.com>
2025-06-17[ruby/win32-registry] Minor readme improvements and typo fixesTim Smith
- Put shell commands in code blocks so they can easily be copied from the GitHub UI directly - Fix a few typos - Fix a dead link to MSDN Signed-off-by: Tim Smith <tsmith84@gmail.com> https://github.com/ruby/win32-registry/commit/61a4672df7
2025-06-15[ruby/date] [Bug #21436] check for fixnum lower bound in `m_ajd`Dmitry Dygalo
Issue - https://bugs.ruby-lang.org/issues/21436 Apparently, the lower bound check is missing, which results in overflow & wrapping later on in RB_INT2FIX Signed-off-by: Dmitry Dygalo <dmitry.dygalo@workato.com> https://github.com/ruby/date/commit/67d75e8423
2025-06-15[ruby/date] [Bug #21437] Date#hash for large yearsDmitry Dygalo
Addresses https://bugs.ruby-lang.org/issues/21437 Signed-off-by: Dmitry Dygalo <dmitry.dygalo@workato.com> https://github.com/ruby/date/commit/31f07bc576
2025-06-14Add `open_timeout` as an overall timeout option for `Socket.tcp` (#13368)Misaki Shioi
* Add `open_timeout` as an overall timeout option for `Socket.tcp` [Background] Currently, `TCPSocket.new` and `Socket.tcp` accept two kind of timeout options: - `resolv_timeout`, which controls the timeout for DNS resolution - `connect_timeout`, which controls the timeout for the connection attempt With the introduction of Happy Eyeballs Version 2 (as per [RFC 8305](https://datatracker.ietf.org/doc/html/rfc8305)) in[ Feature #20108](https://bugs.ruby-lang.org/issues/20108) and [Feature #20782](https://bugs.ruby-lang.org/issues/20782), both address resolution and connection attempts are now parallelized. As a result, the sum of `resolv_timeout` and `connect_timeout` no longer represents the total timeout duration. This is because, in HEv2, name resolution and connection attempts are performed concurrently, causing the two timeouts to overlap. Example: When `resolv_timeout: 200ms` and `connect_timeout: 100ms` are set: 1. An IPv6 address is resolved after the method starts immediately (IPv4 is still being resolved). 2. A connection attempt is initiated to the IPv6 address 3. After 100ms, `connect_timeout` is exceeded. However, since `resolv_timeout` still has 100ms left, the IPv4 resolution continues. 4. After 200ms from the start, the method raises a `resolv_timeout` error. In this case, the total elapsed time before a timeout is 200ms, not the expected 300ms (100ms + 200ms). Furthermore, in HEv2, connection attempts are also parallelized. It starts a new connection attempts every 250ms for resolved addresses. This makes the definition of `connect_timeout` even more ambiguous—specifically, it becomes unclear from which point the timeout is counted. Additionally, these methods initiate new connection attempts every 250ms (Connection Attempt Delay) for each candidate address, thereby parallelizing connection attempts. However, this behavior makes it unclear from which point in time the connect_timeout is actually measured. Currently, a `connect_timeout` is raised only after the last connection attempt exceeds the timeout. Example: When `connect_timeout: 100ms` is set and 3 address candidates: 1. Start a connection attempt to the address `a` 2. 250ms after step 1, start a new connection attempt to the address `b` 3. 500ms after step 1, start a new connection attempt to the address `c` 4. 1000ms after step 3 (1000ms after starting the connection to `c`, 1250ms after starting the connection to `b,` and 1500ms after starting the connection to `a`) `connect_timeout` is raised This behavior aims to favor successful connections by allowing more time for each attempt, but it results in a timeout model that is difficult to reason about. These methods have supported `resolv_timeout` and `connect_timeout` options even before the introduction of HEv2. However, in many use cases, it would be more convenient if a timeout occurred after a specified duration from the start of the method. Similar functions in other languages (such as PHP, Python, and Go) typically allow specifying only an overall timeout. [Proposal] I propose adding an `open_timeout` option to `Socket.tcp` in this PR, which triggers a timeout after a specified duration has elapsed from the start of the method. The name `open_timeout` aligns with the existing accessor used in `Net::HTTP`. If `open_timeout` is specified together with `resolv_timeout` and `connect_timeout`, I propose that only `open_timeout` be used and the others be ignored. While it is possible to support combinations of `open_timeout`, `resolv_timeout`, and `connect_timeout`, doing so would require defining which timeout takes precedence in which situations. In this case, I believe it is more valuable to keep the behavior simple and easy to understand, rather than supporting more complex use cases. If this proposal is accepted, I also plan to extend `open_timeout` support to `TCPSocket.new`. While the long-term future of `resolv_timeout` and `connect_timeout` may warrant further discussion, I believe the immediate priority is to offer a straightforward way to specify an overall timeout. [Outcome] If `open_timeout` is also supported by `TCPSocket.new`, users would be able to manage total connection timeouts directly in `Net::HTTP#connect` without relying on `Timeout.timeout`. https://github.com/ruby/ruby/blob/aa0f689bf45352c4a592e7f1a044912c40435266/lib/net/http.rb#L1657 --- * Raise an exception if it is specified together with other timeout options > If open_timeout is specified together with resolv_timeout and connect_timeout, I propose that only open_timeout be used and the others be ignored. Since this approach may be unclear to users, I’ve decided to explicitly raise an `ArgumentError` if these options are specified together. * Add doc * Fix: open_timeout error should be raised even if there are still addresses that have not been tried Notes: Merged-By: shioimm <shioi.mm@gmail.com>
2025-06-13[ruby/date] d_lite_marshal_load: copy ivars in the right orderJean Boussier
https://github.com/ruby/date/commit/dbf4e957dc
2025-06-13[ruby/date] Remove references to FL_EXIVARJean Boussier
This flag isn't really meant to be public, it's an implementation detail of Ruby. And checking it before calling `rb_copy_generic_ivar` only save a function call. https://github.com/ruby/date/commit/8175252653
2025-06-12Turn `rb_classext_t.fields` into a T_IMEMO/class_fieldsJean Boussier
This behave almost exactly as a T_OBJECT, the layout is entirely compatible. This aims to solve two problems. First, it solves the problem of namspaced classes having a single `shape_id`. Now each namespaced classext has an object that can hold the namespace specific shape. Second, it open the door to later make class instance variable writes atomics, hence be able to read class variables without locking the VM. In the future, in multi-ractor mode, we can do the write on a copy of the `fields_obj` and then atomically swap it. Considerations: - Right now the `RClass` shape_id is always synchronized, but with namespace we should likely mark classes that have multiple namespace with a specific shape flag. Notes: Merged: https://github.com/ruby/ruby/pull/13411
2025-06-12[ruby/strscan] Update extconf.rbNobuyoshi Nakada
(https://github.com/ruby/strscan/pull/158) - `have_func` includes "ruby.h" by default. - include "ruby/re.h" where `rb_reg_onig_match` is declared. https://github.com/ruby/strscan/commit/1ac96f47e9
2025-06-11Refactor the last references to `rb_shape_t`Jean Boussier
The type isn't opaque because Ruby isn't often compiled with LTO, so for optimization purpose it's better to allow as much inlining as possible. However ideally only `shape.c` and `shape.h` should deal with the actual struct, and everything else should just deal with opaque `shape_id_t`. Notes: Merged: https://github.com/ruby/ruby/pull/13586
2025-06-11[ruby/date] Update zonetab.h at 2025-06-11Nobuyoshi Nakada
https://github.com/ruby/date/commit/b28617cde0
2025-06-07Get rid of SHAPE_T_OBJECTJean Boussier
Now that we have the `heap_index` in shape flags we no longer need `T_OBJECT` shapes. Notes: Merged: https://github.com/ruby/ruby/pull/13556
2025-06-06Bump up strscan version to 3.1.6.devHiroshi SHIBATA
2025-06-06[ruby/strscan] Implement Write BarrierDaniel Colson
(https://github.com/ruby/strscan/pull/156) StringScanner holds the string being scanned, and a regex for methods like `match?`. Triggering the write barrier for those allows us to mark this as WB protected. https://github.com/ruby/strscan/commit/32fec70407
2025-06-05[ruby/date] Suppress warnings by gcc-13 with `-Og`Nobuyoshi Nakada
https://github.com/ruby/date/commit/6dd7969a64
2025-06-05Suppress warnings by gcc-13 with `-Og`Nobuyoshi Nakada
2025-06-05[ruby/stringio] Extract internal part as the functionNobuyoshi Nakada
`str_chilled_p` (https://github.com/ruby/stringio/pull/136) https://github.com/ruby/stringio/commit/3c52ddc4c8
2025-06-04Implement write barrier for addrinfoDaniel Colson
`rb_addrinfo_t` has `VALUE inspectname` and `VALUE canonname`, so this triggers the write barrier for those. The `AddrInfo` wasn't readily available where we need to call `RB_OBJ_WRITE`, so this involves passing `self` around a bit. Notes: Merged: https://github.com/ruby/ruby/pull/13503
2025-06-04Get rid of TOO_COMPLEX shape typeJean Boussier
Instead it's now a `shape_id` flag. This allows to check if an object is complex without having to chase the `rb_shape_t` pointer. Notes: Merged: https://github.com/ruby/ruby/pull/13511
2025-06-04Get rid of frozen shapes.Jean Boussier
Instead `shape_id_t` higher bits contain flags, and the first one tells whether the shape is frozen. This has multiple benefits: - Can check if a shape is frozen with a single bit check instead of dereferencing a pointer. - Guarantees it is always possible to transition to frozen. - This allow reclaiming `FL_FREEZE` (not done yet). The downside is you have to be careful to preserve these flags when transitioning. Notes: Merged: https://github.com/ruby/ruby/pull/13289
2025-05-27Get rid of `rb_shape_id(rb_shape_t *)`Jean Boussier
We should avoid conversions from `rb_shape_t *` into `shape_id_t` outside of `shape.c` as the short term goal is to have `shape_id_t` contain tags. Notes: Merged: https://github.com/ruby/ruby/pull/13448
2025-05-26[ruby/json] Release 2.12.2Jean Boussier
https://github.com/ruby/json/commit/a29cb77d52
2025-05-26[ruby/json] Release 2.12.1Jean Boussier
https://github.com/ruby/json/commit/8603a57a91
2025-05-26[ruby/json] fbuffer.c: add debug mode with bound checks.Jean Boussier
This would have caught https://github.com/ruby/json/pull/808 on CI. https://github.com/ruby/json/commit/8109421fb4
2025-05-26[ruby/json] Fix: generate_json_float to reserve enough memory for large ↵Jean Boussier
negative floats. Fix: https://github.com/ruby/json/issues/807 Since https://github.com/ruby/json/pull/800, `fpconv_dtoa` can actually generate up to 28 chars. https://github.com/ruby/json/commit/d73ae93d3c
2025-05-20Make Addrinfo objects Ractor shareableAaron Patterson
Allow Addrinfo objects to be shared among Ractors. Addrinfo objects are already immutable, so I think it's safe for us to tag them as RUBY_TYPED_FROZEN_SHAREABLE shareable too. Notes: Merged: https://github.com/ruby/ruby/pull/13388
2025-05-19[ruby/json] Remove some unnecessary top level constant lookupsJean Boussier
https://github.com/ruby/json/commit/7c03ffc3e0
2025-05-19[ruby/json] remove redundant `self.`GrantBirki
https://github.com/ruby/json/commit/c060943d04