summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2025-01-20[ruby/json] parser.c: Pass the JSON_ParserConfig pointerJean Boussier
Doesn't make a measurable performance difference but is a bit clearer. https://github.com/ruby/json/commit/314d117c61 Notes: Merged: https://github.com/ruby/ruby/pull/12598
2025-01-20[ruby/json] Use RSTRING_ENDJean Boussier
https://github.com/ruby/json/commit/dd9c46c805 Notes: Merged: https://github.com/ruby/ruby/pull/12598
2025-01-20[ruby/json] Replace fbuffer by stack buffers or RB_ALLOCV in parser.cJean Boussier
We only use that buffer for parsing integer and floats, these are unlikely to be very big, and if so we can just use RB_ALLOCV as it will almost always end in a small `alloca`. This allow to no longer need `rb_protect` around the parser. https://github.com/ruby/json/commit/994859916a Notes: Merged: https://github.com/ruby/ruby/pull/12598
2025-01-20[ruby/json] Implement write barriers for ParserConfig objectsJean Boussier
https://github.com/ruby/json/commit/591056a526 Notes: Merged: https://github.com/ruby/ruby/pull/12598
2025-01-20Finalize Kevin's handrolled parser.Jean Boussier
And get rid of the Ragel parser. This is 7% faster on activitypub, 15% after on twitter and 11% faster on citm_catalog. There might be some more optimization opportunities, I did a quick optimization pass to fix a regression in string parsing, but other than that I haven't dug much in performance. Notes: Merged: https://github.com/ruby/ruby/pull/12598
2025-01-17[ruby/psych] Bump version for releaseCharles Oliver Nutter
https://github.com/ruby/psych/commit/2af9f6ac02
2025-01-16Migrate win32ole as bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12583
2025-01-15[ruby/psych] Update to SnakeYAML-Engine 2.9Charles Oliver Nutter
Fixes ruby/psych#689 https://github.com/ruby/psych/commit/ac887cdc76
2025-01-15[ruby/psych] remove vim settingsAaron Patterson
https://github.com/ruby/psych/commit/2f46abf4e1
2025-01-15Link `bin` as well as `lib` so that `Gem.bin_path` worksNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12578
2025-01-14[ruby/openssl] engine: remove mention of LibreSSL from OpenSSL::EngineKazuki Yamaguchi
These paths are only reachable when it is compiled against OpenSSL. LibreSSL 3.9 does not support ENGINE and defines OPENSSL_NO_ENGINE. https://github.com/ruby/openssl/commit/e153d6ab47
2025-01-14[ruby/openssl] ossl.c: use OPENSSL_init_ssl() and OpenSSL_version() with ↵Kazuki Yamaguchi
LibreSSL LibreSSL 2.7.0 added support for OPENSSL_init_ssl() and OpenSSL_version(). https://github.com/ruby/openssl/commit/1328415097
2025-01-14[ruby/openssl] Require LibreSSL 3.9 or laterKazuki Yamaguchi
Drop support for LibreSSL 3.1-3.8. LibreSSL 3.8 has reached its EOL in 2024-10. https://github.com/ruby/openssl/commit/f33d611f9f
2025-01-14[ruby/openssl] Refactor buffer usage to only use `append_as_bytes`Jean Boussier
https://github.com/ruby/openssl/commit/28f2901c48
2025-01-14[ruby/openssl] Reduce OpenSSL::Buffering#do_write overheadJean Boussier
[Bug #20972] The `rb_str_new_freeze` was added in https://github.com/ruby/openssl/issues/452 to better handle concurrent use of a Socket, but SSL sockets can't be used concurrently AFAIK, so we might as well just error cleanly. By using `rb_str_locktmp` we can ensure attempts at concurrent write will raise an error, be we avoid causing a copy of the bytes. We also use the newer `String#append_as_bytes` method when available to save on some more copies. https://github.com/ruby/openssl/commit/0d8c17aa85 Co-Authored-By: luke.gru@gmail.com
2025-01-14Use LRAMA instead of BISONydah
Notes: Merged: https://github.com/ruby/ruby/pull/12556
2025-01-14[ruby/json] Fix a method redefinition warning in C parserJean Boussier
Ref: https://github.com/ruby/json/pull/728 Ref: https://github.com/ruby/ruby/pull/12569 https://github.com/ruby/json/commit/30a4a86954
2025-01-14[ruby/json] Refactor JSON::Ext::Parser to split configuration and parsing stateJean Boussier
Ref: https://github.com/ruby/json/pull/718 The existing `Parser` interface is pretty bad, as it forces to instantiate a new instance for each document. Instead it's preferable to only take the config and do all the initialization needed, and then keep the parsing state on the stack on in ephemeral memory. This refactor makes the `JSON::Coder` pull request much easier to implement in a performant way. https://github.com/ruby/json/commit/c8d5236a92 Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2025-01-14Remove Generator::State#_generateÉtienne Barrié
Co-authored-by: Jean Boussier <jean.boussier@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-14[ruby/fiddle] add regex for bool parsing & test struct w/ boolDmitrii
parsing (https://github.com/ruby/fiddle/pull/169) GitHub: fix https://github.com/ruby/fiddle/pull/168 Struct parsing invokes "parse_ctype" on the whole member signature, which fails if member type is "bool" due to plain string matching for it. This change updates "bool" type matching to a regexp, so TYPE_BOOL is correctly parsed for a whole signature like "bool toggle" as well as just "bool". --------- https://github.com/ruby/fiddle/commit/71607446d4 Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-13[ruby/date] Enclose dangling else in braces and fix -Wmisleading-indentationNobuyoshi Nakada
``` date_strptime.c:253:324: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] 253 | ...((VALUE)RUBY_Qtrue)); return 0; } while (0); si += l; } while (0); | ^ date_strptime.c:252:7: note: previous statement is here 252 | else | ^ ``` https://github.com/ruby/date/commit/41aed5b746
2025-01-13Dependency: ext/-test-/memory_status/dependNobuyoshi Nakada
2025-01-13Stop passing `-t` and `-v` on ripper buildyui-knk
Both of them are debug option. Let's use `YFLAGS` for parse.y build if needed. Notes: Merged: https://github.com/ruby/ruby/pull/12555
2025-01-07Improve lookup tables for string escaping.Jean Boussier
Introduce a simplified table for the most common case, which is `script_safe: false, ascii_only: false`. On the `script_safe` table, now only `0xE2` does a multi-byte check. Merge back `convert_ASCII_to_JSON`, as it no longer help much with the simplified escape table. ``` == Encoding mixed utf8 (5003001 bytes) ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin23] Warming up -------------------------------------- after 38.000 i/100ms Calculating ------------------------------------- after 398.220 (± 3.0%) i/s (2.51 ms/i) - 2.014k in 5.061659s Comparison: before: 381.8 i/s after: 398.2 i/s - same-ish: difference falls within error == Encoding mostly utf8 (5001001 bytes) ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin23] Warming up -------------------------------------- after 39.000 i/100ms Calculating ------------------------------------- after 393.337 (± 2.5%) i/s (2.54 ms/i) - 1.989k in 5.059397s Comparison: before: 304.3 i/s after: 393.3 i/s - 1.29x faster == Encoding twitter.json (466906 bytes) ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin23] Warming up -------------------------------------- after 244.000 i/100ms Calculating ------------------------------------- after 2.436k (± 0.9%) i/s (410.43 μs/i) - 12.200k in 5.007702s Comparison: before: 2125.9 i/s after: 2436.5 i/s - 1.15x faster ```
2025-01-07Remove unused token definitions for `tRPAREN` in Ripper and parser filesydah
Notes: Merged: https://github.com/ruby/ruby/pull/12488
2025-01-06Fix typo for private constant in SocketRaul Gutierrez Segales
Signed-off-by: Raul Gutierrez Segales <rgs@itevenworks.net> Notes: Merged: https://github.com/ruby/ruby/pull/12506
2025-01-02[ruby/stringio] Provide a 'Changelog' link onmark-young-atg
rubygems.org/gems/stringio (https://github.com/ruby/stringio/pull/111) By providing a 'changelog_uri' in the metadata of the gemspec a 'Changelog' link will be shown on https://rubygems.org/gems/stringio which makes it quick and easy for someone to check on the changes introduced with a new version. Details of this functionality can be found on https://guides.rubygems.org/specification-reference/#metadata --------- https://github.com/ruby/stringio/commit/8c084bfcdb Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2024-12-27Win32: Fix sub make commandsNobuyoshi Nakada
`cmd.exe` built-in `cd` does not recognize slashes as path separators, replace to backslashes. Notes: Merged: https://github.com/ruby/ruby/pull/12481
2024-12-27Win32: clean extra object fileNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12481
2024-12-26Bump up fiddle 1.1.7.dev and stringio 3.1.3.devHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12469
2024-12-26[ruby/date] Simplify description of this libraryRyan Bigg
https://github.com/ruby/date/commit/904d4b9607 Notes: Merged: https://github.com/ruby/ruby/pull/12469
2024-12-25[DOC] MonitorNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12467
2024-12-25[DOC] Stop document Ripper::LexerNobuyoshi Nakada
`:nodoc:` seems not working for inner classes.
2024-12-25[DOC] MonitorNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12460
2024-12-25Introduce a timeout to prevent `rb_thread_fd_select` from hanging with ↵Misaki Shioi
write(2) failure (#12457) Rarely, there are cases where a write(2) call from a child thread to notify the main thread of the completion of name resolution fails. If this happens while the main thread is waiting in `rb_thread_fd_select`, rb_thread_fd_select may not notice that the name resolution has completed and end up hanging. This issue becomes a problem when there are no sockets currently being connected, no addresses ready for immediate connection attempts, and name resolution has already completed for one address family while the main thread is waiting for the name resolution of the other address family. (If name resolution is not completed for either address family, the chances of write(2) failing in both child threads are likely low.) To avoid this issue, a timeout is introduced to rb_thread_fd_select under the above conditions. This way, even if the issue occurs, the completion of name resolution should still be detected in the subsequent `if (!resolution_store.is_all_finished) ...` block. Notes: Merged-By: shioimm <shioi.mm@gmail.com>
2024-12-23Improve doc for `Socket::ResolutionError` (#12434)Misaki Shioi
Also, a topic about Socket::ResolutionError is added to NEWS Notes: Merged-By: shioimm <shioi.mm@gmail.com>
2024-12-23use `st_update` to prevent table extensionKoichi Sasada
to prevent the following scenario: 1. `delete_unique_str()` can be called while GC (sweeping) 2. it calls `st_insert()` to decrement the counter 3. `st_insert()` can try to extend the table even if the key exists 4. `xmalloc` while GC and cause BUG Notes: Merged: https://github.com/ruby/ruby/pull/12407
2024-12-22[ruby/openssl] Ruby/OpenSSL 3.3.0Kazuki Yamaguchi
https://github.com/ruby/openssl/commit/e5153dbbb4 Notes: Merged: https://github.com/ruby/ruby/pull/12421
2024-12-22[ruby/openssl] digest: remove optional parameter from OpenSSL::Digest#finishKazuki Yamaguchi
OpenSSL::Digest#finish overrides Digest::Instance#finish and is called from the Digest::Class framework in the digest library. This method is not supposed to take any arguments, as suggested by the RDoc comment for Digest::Instance#finish. It is a private method and not exposed to users. Let's remove it. This optional parameter exists since r15602 in Ruby trunk, the commit which converted OpenSSL::Digest to a subclass of Digest::Class. https://github.com/ruby/openssl/commit/dcb2a4f30b Notes: Merged: https://github.com/ruby/ruby/pull/12421
2024-12-22[ruby/openssl] digest: make output buffer String independent in #finishKazuki Yamaguchi
Likewise, OpenSSL::Digest#finish needs to make the output buffer independent before writing to it. https://github.com/ruby/openssl/commit/9cc8a83466 Notes: Merged: https://github.com/ruby/ruby/pull/12421
2024-12-22[ruby/openssl] cipher: make output buffer String independentKazuki Yamaguchi
OpenSSL::Cipher#update accepts a String as the second argument to be used as the output buffer. The buffer must be directly writable, in other words, it must not be frozen and not a shared string. rb_str_resize() does not make the String independent if the String already has the intended length. Use the rb_str_modify() family instead to check it. Fixes: https://bugs.ruby-lang.org/issues/20937 https://github.com/ruby/openssl/commit/1de3b80a46 Notes: Merged: https://github.com/ruby/ruby/pull/12421
2024-12-22[ruby/openssl] pkcs12: add PKCS12#set_macKazuki Yamaguchi
Add a binding for PKCS12_set_mac() to set MAC parameters and (re-)calculate MAC for the content. This allows generating PKCS #12 with consistent MAC parameters with different OpenSSL versions. OpenSSL 3.0 changed the default hash function used for HMAC and the KDF from SHA-1 to SHA-256. Fixes: https://github.com/ruby/openssl/issues/772 https://github.com/ruby/openssl/commit/f5ed2a74b6 Notes: Merged: https://github.com/ruby/ruby/pull/12421
2024-12-19Prefix asan_poison_object with rbPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12385
2024-12-19[ruby/json] Release 2.9.1Jean Boussier
https://github.com/ruby/json/commit/f745ec145e Notes: Merged: https://github.com/ruby/ruby/pull/12394
2024-12-19[ruby/json] Add support for Solaris 10 which lacks strnlen()Naohisa Goto
Check for existence of strnlen() and use alternative code if it is missing. https://github.com/ruby/json/commit/48d4bbc3a0 Notes: Merged: https://github.com/ruby/ruby/pull/12394
2024-12-18[ruby/psych] Bump up v5.2.2Hiroshi SHIBATA
https://github.com/ruby/psych/commit/746e1ad24d
2024-12-18Wrap `do_fast_fallback_getaddrinfo` with `rb_thread_prevent_fork` (#12366)Misaki Shioi
Wrap `do_fast_fallback_getaddrinfo` with `rb_thread_prevent_fork` Referencing PR #10864, wrap `do_fast_fallback_getaddrinfo` with `rb_thread_prevent_fork` to avoid fork safety issues. `do_fast_fallback_getaddrinfo` internally uses getaddrinfo(3), leading to fork safety issues, as described in PR #10864. This change ensures that `do_fast_fallback_getaddrinfo` is guarded by `rb_thread_prevent_fork`, preventing fork during its execution and avoiding related issues. Notes: Merged-By: shioimm <shioi.mm@gmail.com>
2024-12-17[ruby/win32ole] Bump up v1.9.1Hiroshi SHIBATA
https://github.com/ruby/win32ole/commit/3e9b3b02e9
2024-12-16Check whether object is valid in allocation_info_tracer_compactPeter Zhu
When reference updating ObjectSpace.trace_object_allocations, we need to check whether the object is valid or not because it does not mark the object so the object may be dead. This can cause a segmentation fault if the object is on a free heap page. For example, the following script crashes: require "objspace" objs = [] ObjectSpace.trace_object_allocations do 1_000_000.times do objs << Object.new end end objs = nil # Free pages that the objs were on GC.start # Run compaction and check that it doesn't crash GC.compact Notes: Merged: https://github.com/ruby/ruby/pull/12360
2024-12-16Fix ObjectSpace.trace_object_allocations for compactionPeter Zhu
We need to reinsert into the ST table when an object moves because it is a numtable that hashes on the object address, so when an object moves we need to reinsert it rather than just updating the key. Notes: Merged: https://github.com/ruby/ruby/pull/12339