Skip to content

Refactor JRuby string encoders to get rid of relative offset - #1148

Open
byroot wants to merge 1 commit into
ruby:masterfrom
byroot:no-more-ptr
Open

byroot wants to merge 1 commit into
ruby:masterfrom
byroot:no-more-ptr

Conversation

@byroot

@byroot byroot commented Nov 15, 2026

Copy link
Copy Markdown
Member

Every single buffer access need to use ptr + pos, this is very error prone as it can easily be forgotten and the error will only surface with shared string, which aren't normally created by the test suite.

Instead initialize beg and pos with the real buffer offset, and get rid of the ptr variable entirely.

Every single buffer access need to use `ptr + pos`, this is very
error prone as it can easily be forgotten and the error will only
surface with shared string, which aren't normally created by
the test suite.

Instead initialize `beg` and `pos` with the real buffer offset,
and get rid of the `ptr` variable entirely.

This branch has not been deployed

No deployments
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.

1 participant