summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2024-06-04Remove dependency on fiddle from test/rubyHiroshi SHIBATA
Co-authored-by: "Nobuyoshi Nakada" <nobu@ruby-lang.org>
2024-06-04[ruby/win32ole] Added missing extensionsHiroshi SHIBATA
https://github.com/ruby/win32ole/commit/8456e8830e
2024-06-04[flori/json] Use the pure-Ruby generator on TruffleRuby as it is much fasterBenoit Daloze
* Using the benchmark from https://github.com/flori/json/pull/580 $ ruby benchmarks/bench.rb dump pure JSON::Pure::Generator truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux] Warming up -------------------------------------- JSON.dump(obj) 116.000 i/100ms JSON.dump(obj) 235.000 i/100ms JSON.dump(obj) 317.000 i/100ms JSON.dump(obj) 372.000 i/100ms JSON.dump(obj) 374.000 i/100ms Calculating ------------------------------------- JSON.dump(obj) 3.735k (± 0.9%) i/s (267.76 μs/i) - 18.700k in 5.007526s JSON.dump(obj) 3.738k (± 0.7%) i/s (267.49 μs/i) - 18.700k in 5.002252s JSON.dump(obj) 3.743k (± 0.7%) i/s (267.18 μs/i) - 19.074k in 5.096375s JSON.dump(obj) 3.747k (± 0.5%) i/s (266.87 μs/i) - 19.074k in 5.090463s JSON.dump(obj) 3.746k (± 0.5%) i/s (266.96 μs/i) - 19.074k in 5.092069s $ ruby benchmarks/bench.rb dump ext JSON::Ext::Generator truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux] Warming up -------------------------------------- JSON.dump(obj) 19.000 i/100ms JSON.dump(obj) 18.000 i/100ms JSON.dump(obj) 18.000 i/100ms JSON.dump(obj) 18.000 i/100ms JSON.dump(obj) 21.000 i/100ms Calculating ------------------------------------- JSON.dump(obj) 221.260 (±10.8%) i/s (4.52 ms/i) - 1.092k in 5.004381s JSON.dump(obj) 221.983 (± 8.1%) i/s (4.50 ms/i) - 1.113k in 5.055574s JSON.dump(obj) 221.446 (± 8.6%) i/s (4.52 ms/i) - 1.113k in 5.073167s JSON.dump(obj) 226.452 (± 7.9%) i/s (4.42 ms/i) - 1.134k in 5.048568s JSON.dump(obj) 227.795 (± 8.3%) i/s (4.39 ms/i) - 1.134k in 5.025187s https://github.com/flori/json/commit/8256455cdc
2024-06-04Sync strscan HEAD again.Hiroshi SHIBATA
https://github.com/ruby/strscan/pull/99 split document with multi-byte chars.
2024-06-04[flori/json] Cleanup useless ifdefJean Boussier
The json gem now requires Ruby 2.3, so there is no point keeping compatibility code for older releases that don't have the TypedData API. https://github.com/flori/json/commit/45c86e153f
2024-06-03[ruby/date] [DOC] specify the unit of return value for Date#-p0pemaru
https://github.com/ruby/date/commit/b3a2c7611e
2024-06-03[ruby/date] Prevent converted gregorian date from GCNobuyoshi Nakada
`m_sf_in_sec` calls `rb_rational_new` that can cause GC. https://github.com/ruby/date/commit/6de449ab6a
2024-06-03Raise EAI_SYSTEM when pthread_create fails in getaddrinfoYusuke Endoh
Previously, EAI_AGAIN was raised. In our CI, "Temporary failure in name resolution" (EAI_AGAIN) is often raised. We are not sure if this was caused by pthread_create failure or getaddrinfo failure. To make it possible to distinguish between them, this changeset raises EAI_SYSTEM instead of EAI_AGAIN on pthread_create failure.
2024-06-02Stop exposing `rb_str_chilled_p`Jean Boussier
[Feature #20205] Now that chilled strings no longer appear as frozen, there is no need to offer an API to check for chilled strings. We however need to change `rb_check_frozen_internal` to no longer be a macro, as it needs to check for chilled strings.
2024-06-01Suppress -Wmaybe-uninitialized warnings with LTONobuyoshi Nakada
2024-05-30[ruby/stringio] Remove special handling of chilled stringsJean Boussier
[Feature #20205] Followup: https://github.com/ruby/stringio/pull/94 They no longer need to be special cases. If StringIO end up mutating a chilled string, a warning will be emitted. https://github.com/ruby/stringio/commit/dc62d65449
2024-05-30Revert "[ruby/strscan] Doc for StringScanner"Hiroshi SHIBATA
This reverts commit 974ed1408c516d1e8f992f0b304e2de6f8bd5c1f.
2024-05-30Revert "Fix reference path for strscan documentation"Hiroshi SHIBATA
This reverts commit 1fa93fb9488a32018101689fd727965fd5874eb5.
2024-05-30Fix reference path for strscan documentationHiroshi SHIBATA
2024-05-30[ruby/strscan] Doc for StringScannerBurdette Lamar
(https://github.com/ruby/strscan/pull/96) #peek_byte and #scan_byte not updated (not available in my repo -- sorry). --------- https://github.com/ruby/strscan/commit/0123da7352 Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2024-05-29[ruby/zlib] Update license files with ruby/rubyHiroshi SHIBATA
https://github.com/ruby/zlib/commit/8341fa2e20
2024-05-28Test for compiling without warnings against public headersMike Dalessio
Under compilers with WERRORFLAG, MakeMakefile.try_compile treats warnings as errors, so we can use append_cflags to test whether the public header files emit warnings with certain flags turned on. [Regression test for feature #20507]
2024-05-21ripper: Extend to represent array access and splatNobuyoshi Nakada
2024-05-21ripper: Allow parenthesized comma in optionsNobuyoshi Nakada
2024-05-21ripper: Preserve indentationNobuyoshi Nakada
2024-05-21ripper: Remove rb_ripper_noneNobuyoshi Nakada
Now it is used only for wheter `opt_paren_args` is `none`. Introduce a new special node to distinguish an empty parentheses from it .
2024-05-21ripper: Short hand for `rb_ary_new_from_args`Nobuyoshi Nakada
2024-05-21ripper: Make `$:n` to refer each grammar valuesNobuyoshi Nakada
Ripper DSL uses these values for callbacks, but does not need indexes.
2024-05-14[ruby/zlib] Avoid double copying into provided outbufSamuel Giddins
https://github.com/ruby/zlib/commit/07f44b7546
2024-05-14[ruby/zlib] Avoid allocating intermediary strings when read/readpartial are ↵Samuel Giddins
passed an outbuf This accounts for a significant number of string allocations when reading rubygems, but we can avoid that in many places by only copying into the outbuf when present https://github.com/ruby/zlib/commit/d25ef406c1
2024-05-08[ruby/openssl] Add to_text for PKCS7 and Timestamp::ResponseSamuel Giddins
https://github.com/ruby/openssl/commit/71cd1e3f5c
2024-05-05[ruby/openssl] read: don't clear buffer when nothing can be readJean Boussier
To be consistent with regular Ruby IOs: ```ruby r, _ = IO.pipe buf = "garbage".b r.read_nonblock(10, buf, exception: false) # => :wait_readable p buf # => "garbage" ``` Ref: https://github.com/redis-rb/redis-client/commit/98b8944460a11f8508217bda71cfc10cb2190d4d https://github.com/ruby/openssl/commit/08452993d6
2024-05-04Change return value of `gets` function to be `rb_parser_string_t *` instead ↵yui-knk
of `VALUE` This change reduces parser's dependency on ruby object.
2024-05-03win32/registry: Shorten with safe navigation operatorNobuyoshi Nakada
2024-05-03win32/registry: Make frozen_string_literal trueNobuyoshi Nakada
2024-05-03win32/registry: Refine pack/unpackNobuyoshi Nakada
* Use 'J' for HANDLE. * Use 'Q' for QWORD. * Define template constants. * Supply zero bytes in `unpackqw` as well as `unpackdw`. * Use `String#unpack1`.
2024-05-02[ruby/openssl] pkcs7: raise PKCS7Error for PKCS7 without content in ↵Jeremy Evans
PKCS7.read_smime [pkuzco: expanded the fix for other content types] [ky: adjusted formatting and the exception type] https://github.com/ruby/openssl/commit/07eceb7f63 Co-authored-by: pkuzco <b.naamneh@gmail.com> Co-authored-by: Kazuki Yamaguchi <k@rhe.jp>
2024-05-02[ruby/openssl] pkcs7: raise ArgumentError for PKCS7 with no content in PKCS7.newJeremy Evans
Fixes [Bug #19974] [pkuzco: expanded the fix for other content types] [ky: adjusted formatting and the exception type] https://github.com/ruby/openssl/commit/27e11f2d1d Co-authored-by: pkuzco <b.naamneh@gmail.com> Co-authored-by: Kazuki Yamaguchi <k@rhe.jp>
2024-05-02[ruby/openssl] cipher: fix buffer overflow in Cipher#updateKazuki Yamaguchi
OpenSSL::Cipher#update currently allocates the output buffer with size (input data length)+(the block size of the cipher). This is insufficient for the id-aes{128,192,256}-wrap-pad (AES keywrap with padding) ciphers. They have a block size of 8 bytes, but the output may be up to 15 bytes larger than the input. Use (input data length)+EVP_MAX_BLOCK_LENGTH (== 32) as the output buffer size, instead. OpenSSL doesn't provide a generic way to tell the maximum required buffer size for ciphers, but this is large enough for all algorithms implemented in current versions of OpenSSL. Fixes: https://bugs.ruby-lang.org/issues/20236 https://github.com/ruby/openssl/commit/3035559f54
2024-05-02[ruby/openssl] Fix performance regression in do_write(s)Jaymz Julian
This causes significant performance issues when using large (>10meg) writes Fix by adjusting the buffer write function to clear the buffer once, rather than piece by piece, avoiding a case where a large write (in our case, around 70mbytes) will consume 100% of CPU. This takes a webrick GET request via SSL from around 200kbyts/sec and consuming 100% of a core, to line speed on gigabit ethernet and 6% cpu utlization. https://github.com/ruby/openssl/commit/d4389b425d
2024-05-02[ruby/openssl] asn1: check error return from i2d_ASN1_TYPE()Kazuki Yamaguchi
i2d_ASN1_TYPE() is not expected to fail, but the return value should be checked. https://github.com/ruby/openssl/commit/21ed3c310e
2024-04-30[ruby/openssl] Update Cipher#name to match Digest#name explanationBart de Water
https://github.com/ruby/openssl/commit/79e6dead6e
2024-04-30[ruby/openssl] Add OpenSSL::Digest.digests to get a list of available digestsBart de Water
https://github.com/ruby/openssl/commit/08dd3c73b7
2024-04-30[ruby/openssl] Further clarification of documentation.Samuel Williams
https://github.com/ruby/openssl/commit/0697f2f8b4
2024-04-30[ruby/openssl] More documentation.Samuel Williams
https://github.com/ruby/openssl/commit/c8377eaf8d
2024-04-30[ruby/openssl] Introduce basic support for `close_read` and `close_write`.Samuel Williams
https://github.com/ruby/openssl/commit/c99d24cee9
2024-04-29ripper: Move DSL line patternNobuyoshi Nakada
2024-04-29Use user defined parameterizing rulesydah
2024-04-27ruby tool/update-deps --fix卜部昌平
2024-04-26Enable Ruby to run on Windows with frozen string literalsSam Aaron
2024-04-24Fix dllimport warningsNobuyoshi Nakada
From Visual C: ``` ../../../../../src/ext/-test-/load/resolve_symbol_target/resolve_symbol_target.c(5): warning C4273: 'rst_any_method': inconsistent dll linkage D:\a\ruby\ruby\src\ext\-test-\load\resolve_symbol_target\resolve_symbol_target.h(4): note: see previous definition of 'rst_any_method' ../../../../../src/ext/-test-/load/stringify_target/stringify_target.c(5): warning C4273: 'stt_any_method': inconsistent dll linkage D:\a\ruby\ruby\src\ext\-test-\load\stringify_target\stringify_target.h(4): note: see previous definition of 'stt_any_method' ``` From MinGW gcc: ``` ../../../../../src/ext/-test-/load/resolve_symbol_target/resolve_symbol_target.c:5:1: warning: 'rst_any_method' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] compiling ../../../../../src/ext/-test-/marshal/compat/usrcompat.c 5 | rst_any_method(VALUE klass) | ^~~~~~~~~~~~~~ ../../../../../src/ext/-test-/load/stringify_target/stringify_target.c:5:1: warning: 'stt_any_method' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] 5 | stt_any_method(VALUE klass) | ^~~~~~~~~~~~~~ ```
2024-04-23Move encoding object conversion outside of parseryui-knk
Reduce the parser's dependence on `VALUE` and `rb_enc_from_encoding`.
2024-04-23Adjust indent [ci skip]Nobuyoshi Nakada
2024-04-23Refactor parser compile functionsyui-knk
Refactor parser compile functions to reduce the dependence on ruby functions. This commit includes these changes 1. Refactor `gets`, `input` and `gets_` of `parser_params` Parser needs two different data structure to get next line, function (`gets`) and input data (`input`). However `gets_` is used for both function (`call`) and input data (`ptr`). `call` is used for managing general callback function when `rb_ruby_parser_compile_generic` is used. `ptr` is used for managing the current pointer on String when `parser_compile_string` is used. This commit changes parser to used only `gets` and `input` then removes `gets_`. 2. Move parser_compile functions and `gets` functions from parse.y to ruby_parser.c This change reduces the dependence on ruby functions from parser. 3. Change ruby_parser and ripper to take care of `VALUE input` GC mark Move the responsibility of calling `rb_gc_mark` for `VALUE input` from parser to ruby_parser and ripper. `input` is arbitrary data pointer from the viewpoint of parser. 4. Introduce rb_parser_compile_array function Caller of `rb_parser_compile_generic` needs to take care about GC because ruby_parser doesn’t know about the detail of `lex_gets` and `input`. Introduce `rb_parser_compile_array` to reduce the complexity of ast.c.
2024-04-19Remove UPDATE_LIBRARIESNobuyoshi Nakada
It has not been used since e48375c112022fa321786ccd95dd4e718efd78a3.