summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2024-04-17[ruby/stringio] strio_read: preserve buffer encoding on partialJean byroot Boussier
reads (https://github.com/ruby/stringio/pull/95) [[Bug #20418]](https://bugs.ruby-lang.org/issues/20418) Ruby IO#read preserves the encoding on partial read, but change it when reading the whole IO from commit https://github.com/ruby/ruby/commit/0ca7036682da: > * io.c (read_all): should associate default external encoding. > * io.c (io_read): should NOT associate default external encoding. https://github.com/ruby/stringio/commit/073172da31 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-04-16[ruby/pathname] Remove check for File.birthtimePeter Zhu
File.birthtime has existed since Ruby 2.2, and pathname requires Ruby >= 2.7.0, so the method will always be there. https://github.com/ruby/pathname/commit/aca9613bbf
2024-04-14[pty] Fix missing `or`Nobuyoshi Nakada
2024-04-14[pty] Fix `ptsname_r` fallbackNobuyoshi Nakada
If `posix_openpt` is available, also `ptsname` should be available.
2024-04-14Remove undefined function's prototype declarationyui-knk
89cfc152071 removed the definition of these functions.
2024-04-11[pty] Support `ptsname_r` of glibcNobuyoshi Nakada
Although glibc `ptsname_r` man page mentions Tru64 and HP-UX, this function appears to be declared obsolete on both.
2024-04-09[pty] Split `chfunc` into functions in stepsNobuyoshi Nakada
- start a new session - obtain the new controlling terminal - drop privileges - finally, `exec`
2024-04-07Fix a typo, missing `P` in `SETPGRP_VOID`Nobuyoshi Nakada
2024-04-04Revert "hijack SIGCHLD handler for internal use"Nobuyoshi Nakada
This reverts commit 054a412d540e7ed2de63d68da753f585ea6616c3. SIGCHLD `waidpid`, `waitpid_lock` and related code, have been removed at ruby/ruby#7527.
2024-04-04[flori/json] Bump up 2.7.2Hiroshi SHIBATA
https://github.com/flori/json/commit/036944acc6
2024-04-04[flori/json] Warn to install ostruct if json couldn't load itHiroshi SHIBATA
https://github.com/flori/json/commit/fff285968d
2024-04-04[flori/json] Autoload GenericObject to avoid require ostruct warning in Ruby 3.4tompng
https://github.com/flori/json/commit/b507f9e404
2024-04-02Remove `rb_imemo_tmpbuf_t` from parseryui-knk
No parser semantic value types are `VALUE` then no need to use imemo for managing semantic value stack anymore.
2024-04-02[Feature #20331] Simplify parser warnings for hash keys duplication and when ↵yui-knk
clause duplication This commit simplifies warnings for hash keys duplication and when clause duplication, based on the discussion of https://bugs.ruby-lang.org/issues/20331. Warnings are reported only when strings are same to ohters.
2024-03-28Use www.rfc-editor.org for RFC text.Hiroshi SHIBATA
We use the following site for that now: * https://tools.ietf.org/ or http * https://datatracker.ietf.org or http Today, IETF said the official site of RFC is www.rfc-editor.org. FYI: https://authors.ietf.org/en/references-in-rfcxml I replaced them to www.rfc-editor.org.
2024-03-27[ruby/stringio] Extract `readonly_string_p`Nobuyoshi Nakada
https://github.com/ruby/stringio/commit/0da5b725c8
2024-03-28[ruby/stringio] Adjust styles [ci skip]Nobuyoshi Nakada
https://github.com/ruby/stringio/commit/4e8e82fc30
2024-03-28[ruby/stringio] Eagerly defrost chilled stringsÉtienne Barrié
[Feature #20390] https://github.com/ruby/stringio/commit/17ee957f34 Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-27[flori/json] Fix memory leak when exception is raised during JSON generationPeter Zhu
If an exception is raised the FBuffer is leaked. For example, the following script leaks memory: o = Object.new def o.to_json(a) = raise 10.times do 100_000.times do begin JSON(o) rescue end end puts `ps -o rss= -p #{$$}` end Before: 31824 35696 40240 44304 47424 50944 54000 58384 62416 65296 After: 24416 24640 24640 24736 24736 24736 24736 24736 24736 24736 https://github.com/flori/json/commit/44df509dc2
2024-03-26Expose rb_str_chilled_pÉtienne Barrié
Some extensions (like stringio) may need to differentiate between chilled strings and frozen strings. They can now use rb_str_chilled_p but must check for its presence since the function will be removed when chilled strings are removed. [Bug #20389] [Feature #20205] Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-24Use dedicated methods to abortNobuyoshi Nakada
When `RUBY_DEBUG` is set, accessing a class in an invalid object will cause a breakpoint trap instead of a segfault on some implementations.
2024-03-24Move `-test-/fatal/rb_fatal` to `-test-/fatal`Nobuyoshi Nakada
2024-03-23[ruby/win32ole] Refine pathspecs for `spec.files`Nobuyoshi Nakada
https://github.com/ruby/win32ole/commit/8d443417a9
2024-03-23[ruby/win32ole] Exclude unused files from packagesNobuyoshi Nakada
https://github.com/ruby/win32ole/commit/f4aff99dda
2024-03-22Match `--with/--without` options against gem namesNobuyoshi Nakada
The simple names in `default_exclude_exts` do not match extension paths under gems. Extract each gem name from the gemspec file at the top level of each gem directory. For example, if `ext` is `syslog-0.1.2/ext/syslog/`, find out `syslog-0.1.2/syslog.gemspec` and take the base name `syslog` without the suffix `.gemspec`.
2024-03-22Pass blocks to blocks as block parametersNobuyoshi Nakada
2024-03-21Fix Ripper memory allocation size when enabled Universal ParserS-H-GAMELINKS
The size of `struct parser_params` is 8 bytes difference in `ripper_s_allocate` and `rb_ruby_parser_allocate` when the universal parser is enabled. This causes a situation where `*r->p` is not fully initialized in `ripper_s_allocate` as shown below. ```console (gdb) p *r->p $2 = {heap = 0x0, lval = 0x0, yylloc = 0x0, lex = {strterm = 0x0, gets = 0x0, input = 0, string_buffer = {head = 0x0, last = 0x0}, lastlin e = 0x0, nextline = 0x0, pbeg = 0x0, pcur = 0x0, pend = 0x0, ptok = 0x0, gets_ = {ptr = 0, call = 0x0}, state = EXPR_NONE, paren_nest = 0, lpar _seen = 0, debug = 0, has_shebang = 0, token_seen = 0, token_info_enabled = 0, error_p = 0, cr_seen = 0, value = 0, result = 0, parsing_thread = 0, s_value = 0, s_lvalue = 0, s_value_stack = 2097} ```` This seems to cause `double free or corruption (!prev)` and SEGV. So, fixing this by introduce `rb_ripper_parser_params_allocate` and `rb_ruby_parser_config` functions for Ripper, and `struct parser_params` same size is returned.
2024-03-20[ruby/openssl] Revert "Always respect the openssl prefix chosen by ↵Benoit Daloze
truffle/openssl-prefix on TruffleRuby" * This reverts commit https://github.com/ruby/openssl/commit/ca738e7e1357. * No longer needed since https://github.com/oracle/truffleruby/issues/3170 was fixed. https://github.com/ruby/openssl/commit/1f641a5604
2024-03-19Implement chilled stringsÉtienne Barrié
[Feature #20205] As a path toward enabling frozen string literals by default in the future, this commit introduce "chilled strings". From a user perspective chilled strings pretend to be frozen, but on the first attempt to mutate them, they lose their frozen status and emit a warning rather than to raise a `FrozenError`. Implementation wise, `rb_compile_option_struct.frozen_string_literal` is no longer a boolean but a tri-state of `enabled/disabled/unset`. When code is compiled with frozen string literals neither explictly enabled or disabled, string literals are compiled with a new `putchilledstring` instruction. This instruction is identical to `putstring` except it marks the String with the `STR_CHILLED (FL_USER3)` and `FL_FREEZE` flags. Chilled strings have the `FL_FREEZE` flag as to minimize the need to check for chilled strings across the codebase, and to improve compatibility with C extensions. Notes: - `String#freeze`: clears the chilled flag. - `String#-@`: acts as if the string was mutable. - `String#+@`: acts as if the string was mutable. - `String#clone`: copies the chilled flag. Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-17Remove no longer needed matchingNobuyoshi Nakada
2024-03-17Revert "Remove flip-flop usages from build scripts"Nobuyoshi Nakada
This reverts commit 301fa452f7a9cdea922103e9c50d85a2d5652d0d.
2024-03-15[ruby/stringio] NULL StringIO by `StringIO.new(nil)`Nobuyoshi Nakada
https://github.com/ruby/stringio/commit/779f71359d
2024-03-14Ensure test suite is compatible with --frozen-string-literalJean Boussier
As preparation for https://bugs.ruby-lang.org/issues/20205 making sure the test suite is compatible with frozen string literals is making things easier.
2024-03-14[ruby/stringio] [DOC] Package rdoc filesNobuyoshi Nakada
https://github.com/ruby/stringio/commit/8522c90e4b
2024-03-14[ruby/stringio] [DOC] Add missing documentsNobuyoshi Nakada
https://github.com/ruby/stringio/commit/9cc1dfa19c
2024-03-14[ruby/stringio] [DOC] Add rdoc taskNobuyoshi Nakada
https://github.com/ruby/stringio/commit/5dd52d4aec
2024-03-14[ruby/fcntl] [DOC] Package files for RDocNobuyoshi Nakada
https://github.com/ruby/fcntl/commit/b946e505f1
2024-03-14[ruby/fcntl] [DOC] Package document filesNobuyoshi Nakada
https://github.com/ruby/fcntl/commit/ed2d725505
2024-03-14[ruby/fcntl] [DOC] Add missing documentsNobuyoshi Nakada
https://github.com/ruby/fcntl/commit/a201ed6682
2024-03-14[ruby/fcntl] [DOC] Add task and files for RDocNobuyoshi Nakada
https://github.com/ruby/fcntl/commit/1c7c70fa5d
2024-03-14[ruby/fcntl] Reduce duplicate `O_ACCMODE` definitionsNobuyoshi Nakada
https://github.com/ruby/fcntl/commit/6a6442a7f8
2024-03-14[ruby/fcntl] [DOC] Remove redundant directivesNobuyoshi Nakada
https://github.com/ruby/fcntl/commit/a99909a90f
2024-03-13[ruby/stringio] Define `StringIO::MAX_LENGTH`Nobuyoshi Nakada
https://github.com/ruby/stringio/commit/0205bd1c86
2024-03-07RMDIRS includes `-p` option [ci skip]Nobuyoshi Nakada
2024-03-06Move FL_SINGLETON to FL_USER1Jean Boussier
This frees FL_USER0 on both T_MODULE and T_CLASS. Note: prior to this, FL_SINGLETON was never set on T_MODULE, so checking for `FL_SINGLETON` without first checking that `FL_TYPE` was `T_CLASS` was valid. That's no longer the case.
2024-03-05[DOC] Fix invalid documentation for `reachable_objects_from` (#10172)Lazarus Lazaridis
Previous documentation is stating the opposite (that the method won't work for CRuby).
2024-03-03[Bug #20322] Fix rb_enc_interned_str_cstr null encodingThomas Marshall
The documentation for `rb_enc_interned_str_cstr` notes that `enc` can be a null pointer, but this currently causes a segmentation fault when trying to autoload the encoding. This commit fixes the issue by checking for NULL before calling `rb_enc_autoload`.
2024-03-02[ruby/etc] Drop support for old ERBNobuyoshi Nakada
https://github.com/ruby/etc/commit/11677318ac
2024-03-03Drop support for old ERBNobuyoshi Nakada
2024-02-28Skip assert_no_memory_leak when ASAN is enabledKJ Tsanaktsidis
ASAN greatly increases the memory footprint of Ruby, so these static thresholds are not appropriate. There's no real need to run these tests under ASAN. [Bug #20274]