Skip to content

Conversation

ianks
Copy link
Collaborator

@ianks ianks commented May 6, 2025

In Ruby 3.5, the struct definition of RTypedData was changed to optimize its size. To support this, this PR adds rtypeddata_p, rtypeddata_embedded_p, rtypeddata_type, and rtypeddata_get_data in StableApiDefinition for Ruby 2.6–3.4.

- Introduce RTYPEDDATA_P, RTYPEDDATA_EMBEDDED_P, RTYPEDDATA_TYPE, and RTYPEDDATA_GET_DATA macros and stable API methods for working with Ruby's RTypedData objects.
- Provide Ruby version-specific implementations (2.6–3.4) for type checking, embedded data detection, type retrieval, and data pointer access.
- Add comprehensive tests for RTypedData handling in stable_api_test.rs.
- Update CI to test against ruby-head.
- Extend blocklists and opaque structs for RData/RTypedData.
@ianks ianks requested a review from goyox86 May 6, 2025 19:26
Update type and constants to use Compiled struct and Ruby API version constants.
ianks added 2 commits May 6, 2025 16:05
Add cfg to skip failing test on Ruby 3.5 and above.
Moves ruby-head to its own job with Ubuntu and stable Rust,
removing it from the main Ruby matrix to improve CI reliability.
@ianks ianks merged commit 99390c1 into main May 7, 2025
57 checks passed
@ianks ianks deleted the rtyped-data branch May 7, 2025 02:14
Copy link
Collaborator

@goyox86 goyox86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late to the party, retroactive 👍🏼 😅

stanhu added a commit to stanhu/rb-sys that referenced this pull request May 8, 2025
AFter upgrading to rb-sys v0.9.113, we found that oxidize-rb#530 doesn't compile
on 32-bit platform because the typed_data is a VALUE type, but it was
always casted to a 64-bit value.  Fix this by casting
TYPED_DATA_EMBEDDED as a VALUE.

Closes oxidize-rb#534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants