2493 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
7a07a54298
Bump RUBY_ABI_VERSION
Prior to a26f528b3bf1eaecff18520f6ba8083c9c0cbf73, `rbimpl_rtypeddata_p`
checked whether a flag that is no longer used since that commit was set.
As a result, typed data objects created in newer versions of Ruby are
considered as untyped in extension libraries compiled with older headers.
2026-05-29 23:34:40 +09:00
Jean Boussier
4af6e12493 Rename RUBY_FL_USERPRIV0 into RUBY_FL_UNUSED6
Last usage was removed in a26f528b3bf1eaecff18520f6ba8083c9c0cbf73
https://github.com/ruby/ruby/pull/15447
2026-05-29 07:25:03 +02:00
Nobuyoshi Nakada
5497859f40
Remove use of RTYPEDDATA_P and rbimpl_rtypeddata_p 2026-05-28 19:29:32 +09:00
Nobuyoshi Nakada
a26f528b3b
Deprecate struct RData in favor of struct RTypedData
For the backward compatibility for some wrapper generator gems, keep
only `RData` definition.
2026-05-28 19:29:31 +09:00
John Hawthorn
8c854d2cfb Bump RUBY_ABI_VERSION 2026-05-27 16:18:43 -07:00
John Hawthorn
594ae9f073 Give legacy T_DATA the same layout as TypedData
This allows us to treat the two types of T_DATA the same way when
reading instance variables.

Non-TypedData T_DATA are deprecated, so making them faster isn't
particularly important, but it is helpful to avoid needing to test for
TypedData and adding another special case.
2026-05-27 16:18:43 -07:00
Jean Boussier
837f684377 st.c: Store st_table->bins at the end of st_table->entries
Same optimization that was applied to `set_table` in
85c52079aa35a1d2e063a5b40eebe91701c8cb9e

This saves one pointer per `st_table`.
Now that GC support 64B slots, if we can save another 8B
either in `st_table` or in `struct RHash`, hashes would now
fit in 64B slots.
2026-05-17 23:54:19 +03:00
Jean Boussier
5eb4284144 Stop using rb_class_path_cached, and deprecate it.
That API made sense before b00f280d4b9569e7153365d7e1c522b3d6b3c6cf
as finding a module name was costly, but it now is a very cheap
operation, and that function is now just an outdated alias.
2026-05-17 20:15:21 +03:00
John Hawthorn
39d428e356 Build match struct when requested 2026-05-14 07:07:45 -07:00
John Hawthorn
fe3f45187b Allocate RMatch storage embedded
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2026-05-14 07:07:45 -07:00
Nobuyoshi Nakada
78562d38fb
mingw: Include stdio.h for __MINGW_PRINTF_FORMAT
This macro is not pre-defined but defined in stdio.h.
2026-05-10 19:54:36 +09:00
Peter Zhu
39257a3e11 Add field in RObject for too complex hash case
Avoids the need to cast fields into a st_table.
2026-05-03 10:04:57 -04:00
Hiroya Fujinami
493d26dcde
Reject overflowed repeat/null-check IDs in huge regexps (#16801)
Add explicit errors for excessive range-repeat and null-check IDs;
map new errors in regerror; add regression tests for oversized generated
patterns.
2026-04-29 11:09:24 +09:00
Jean Boussier
8d929853d8 Get rid of rb_matchext_struct
It can simply be merged inside `RMatch`.
2026-04-28 15:21:11 +09:00
Jean Boussier
379b95a2df Get rid of RGENGC_WB_PROTECTED_NODE_CREF
It's unused.
2026-04-28 09:39:07 +09:00
Jean Boussier
c95a190d9c Get rid of RGENGC_WB_PROTECTED_BIGNUM
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
70451a4018 Get rid of RGENGC_WB_PROTECTED_RATIONAL
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
5e99295f1e Get rid of RGENGC_WB_PROTECTED_COMPLEX
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
92cba2ef72 Get rid of RGENGC_WB_PROTECTED_FLOAT
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
ac0a319dd5 Get rid of RGENGC_WB_PROTECTED_CLASS
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
9e47f988fb Get rid of RGENGC_WB_PROTECTED_MATCH
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
e9f372a231 Get rid of RGENGC_WB_PROTECTED_REGEXP
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
83d4117b07 Get rid of RGENGC_WB_PROTECTED_OBJECT
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
267ce6f842 Get rid of RGENGC_WB_PROTECTED_STRING
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
9307d1b5b6 Get rid of RGENGC_WB_PROTECTED_STRUCT
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
7040286dfc Get rid of RGENGC_WB_PROTECTED_HASH
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Jean Boussier
e603aa0d2f Get rid of RGENGC_WB_PROTECTED_ARRAY
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
jinroq
0cb9c43318 Expose rb_int_parse_cstr() as public API
Move rb_int_parse_cstr() declaration and RB_INT_PARSE_* flags from
internal/bignum.h to the public header include/ruby/internal/intern/bignum.h
so that C extensions can use this function without writing their own
prototype declarations.

The flags are changed from an enum to #define macros to follow the
convention used in the public header for similar constants.
2026-04-24 18:09:20 +09:00
Jean Boussier
5bd3e85ea1 Make rb_enc_str_coderange inlinable by default
This is a generalization of the optimization done in re.c
as part of d0fbdb005cecd8513aeacb234365d71f9a9b521e.

Code that deal with coderange can benefit significantly from
avoiding that function call, assuming coderange is often already
known.

Ref: https://github.com/ruby/json/pull/974
2026-04-22 08:50:38 +09:00
Nobuyoshi Nakada
b66b500816
Remove postponed job APIs deprecated for 2 years 2026-04-12 16:51:29 +09:00
Jean Boussier
53099633e2 Make ruby_xfree_sized and ruby_xrealloc_sized public
[Feature #21861]
2026-04-01 08:10:07 +01:00
Nobuyoshi Nakada
a53b3fd287
Suppress warnings at Apple clang 21.0.0
`RBIMPL_COMPILER_SINCE(Clang)` excludes Apple clang.  Use simply
`__clang_major__` instead.
2026-03-26 13:25:17 +09:00
Benoit Daloze
fda7e6750d Fix typo 2026-03-25 12:39:25 +01:00
Jean Boussier
67334c020b RTYPEDDATA_DATA: reject embedded typeddata
Callers should use the safer `RTYPEDDATA_GET_DATA`.
2026-03-24 14:57:53 +01:00
Jean Boussier
305b563ec9 Expose and document RUBY_TYPED_EMBEDDABLE
[Feature #21853]
2026-03-23 09:48:47 +01:00
Peter Zhu
a188e960c8 [DOC] Update docs for RB_OBJ_WB_UNPROTECT 2026-03-16 08:16:54 -05:00
John Hawthorn
4b4da98832 Avoid and simplify rb_alloc_tmp_buffer_with_count
There's no reason to ever call this and the "count" value is ignored.
Because this is part of the public API I left it as a stub, but it could
likely be removed.
2026-02-24 09:39:35 -08:00
Jeremy Evans
e7f1746d55 [DOC] Update documentation for RB_{SCAN_ARGS,PASS}_KEYWORDS
When using RB_SCAN_ARGS_KEYWORDS or RB_PASS_KEYWORDS, the final
argument must be a hash.
2026-02-11 13:42:44 +01:00
Nobuyoshi Nakada
cd26647f53 Remove dangling taintedness macros 2026-01-29 16:36:27 +09:00
Herwin
b4a62a1ca9
[DOC] Update docs for rb_interned_str and related functions (#15897)
Related to [Bug #21842].

* rb_interned_str: document what decides whether the returned string is
  in US-ASCII or BINARY encoding.
* rb_interned_str_cstr: include the same description as rb_interned_str
  for the encoding. This one was still missing the update for US-ASCII
  and erroneously said the returned string was alwasy in BINARY encoding
* rb_str_to_interned_str: document how the encoding of the result is
  defined.

Co-authored-by: Herwin <herwinw@users.noreply.github.com>
2026-01-19 11:16:47 +09:00
Nobuyoshi Nakada
78b7646bdb
[Bug #21842] Let rb_interned_str return US-ASCII if possible 2026-01-17 14:19:15 +09:00
Nobuyoshi Nakada
67d4ceb525
Expand rb_data_type_t::reserved for future use 2026-01-16 16:52:32 +09:00
卜部昌平
60cf8598b2 [nit] refactor rename inline functions
Pretty sure commit 0f64da9672d88921439f6fdb306d16fece9b9c90 didn't
intend to welcome extension libraries to use these functions.
2026-01-13 11:53:43 +09:00
K.Takata
ad150e9039
[k-takata/Onigmo] Update version number (6.2.0)
* Update the version number to 6.2.0
* Update LTVERSION to 6:5:0.

https://github.com/k-takata/Onigmo/commit/9e0f7ceee0
2026-01-12 20:01:42 +09:00
K.Takata
916fbf1063
[k-takata/Onigmo] Update copyright information
* Update our copyright information.
* Import the latest information from oniguruma.

Related: #95

https://github.com/k-takata/Onigmo/commit/0d8662b500
2026-01-12 20:01:42 +09:00
K.Takata
bbf9bf3fc5
[k-takata/Onigmo] Remove code for backward BM search
The code has not been used for long.
(Oniguruma also removed this code.)

https://github.com/k-takata/Onigmo/commit/8796781fdd
2026-01-12 20:01:42 +09:00
K.Takata
fb7f344b09
[k-takata/Onigmo] Remove code for reg->int_map
https://github.com/k-takata/Onigmo/commit/6c58de82d2
2026-01-12 20:01:42 +09:00
Heath Dutton🕴️
3363861a5a Remove RUBY_API_VERSION check in cxxanyargs.hpp
The version check used undefined macros, causing -Wundef warnings.
The conditional is no longer needed as Ruby is past version 3.1.
2026-01-11 21:06:51 +09:00
Nobuyoshi Nakada
28b0e5125f [Bug #18433] Remove unneeded declaration
This `rb_cObject` declaration was only for `rb_cData()` that was
removed at 7c738ce5e649b82bdc1305d5c347e81886ee759a.
2026-01-05 16:47:14 +09:00
Peter Zhu
6939f03f4c Add field handle_weak_references to TypedData
This commit adds a field handle_weak_references to rb_data_type_struct for
the callback when handling weak references. This avoids TypedData objects
from needing to expose their rb_data_type_struct and weak references function.
2026-01-04 09:02:40 -05:00