Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Pass position as an argument in WasmBinaryReader #7133

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tlively
Copy link
Member

@tlively tlively commented Dec 4, 2024

Remove the pos member variable that keeps track of the current
position in the input buffer and instead thread the position through all
the calls to the parsing methods. In a future PR that paralellizes the
parsing of function bodies, this will enable the parsing methods to be
called in parallel without unsafely modifying shared state. Using a
parameter for every method rather than just those used while parsing
function bodies makes it impossible by construction to have data races
on the position.

Remove the `pos` member variable that keeps track of the current
position in the input buffer and instead thread the position through all
the calls to the parsing methods. In a future PR that paralellizes the
parsing of function bodies, this will enable the parsing methods to be
called in parallel without unsafely modifying shared state. Using a
parameter for every method rather than just those used while parsing
function bodies makes it impossible by construction to have data races
on the position.
@tlively tlively marked this pull request as draft December 4, 2024 03:28
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