feat(stable-api): add accessor methods (RSTRING_END, RDATA_PTR, RB_OBJ_FREEZE, RB_OBJ_PROMOTED)#679
Draft
feat(stable-api): add accessor methods (RSTRING_END, RDATA_PTR, RB_OBJ_FREEZE, RB_OBJ_PROMOTED)#679
Conversation
Implements #670, #666, #672, #673 - Add rstring_end to StableApiDefinition for RSTRING_END - Add rdata_ptr to StableApiDefinition for DATA_PTR - Add rb_obj_freeze to StableApiDefinition for RB_OBJ_FREEZE - Add rb_obj_promoted, rb_obj_promoted_raw for RB_OBJ_PROMOTED - Implement for Ruby 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 4.0 - Add C fallbacks in compiled.c - Add FFI wrappers in compiled.rs - Add public macro wrappers in macros.rs - Add comprehensive parity tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Batch 5 of the stable API implementation plan - Adds simple accessor methods to the Stable API:
RSTRING_END- Get pointer to end of string contentsRDATA_PTR- Get data pointer from RData objectRB_OBJ_FREEZE- Freeze an objectRB_OBJ_PROMOTED- Check if object is promoted to old GC generationChanges
rstring_end(),rdata_ptr(),rb_obj_freeze(),rb_obj_promoted(), andrb_obj_promoted_raw()methodsRSTRING_END: Composed fromrstring_ptr + rstring_lenRDATA_PTR: Direct access to RData.data fieldRB_OBJ_FREEZE: Callsrb_obj_freeze_inline()RB_OBJ_PROMOTED: ChecksRUBY_FL_PROMOTEDflagcompiled.cand Rust wrapper incompiled.rsmacros.rswith comprehensive documentationstable_api_test.rsTesting
All tests pass successfully ✅
Related Issues
Checklist