Skip to content

Use DataView in bindings generation #2599

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

Merged
merged 4 commits into from
Jan 4, 2023
Merged

Use DataView in bindings generation #2599

merged 4 commits into from
Jan 4, 2023

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Dec 30, 2022

Given the results of this simple experiment, instead of using short-lived views when accessing memory to work around a possibly detached buffer after a memory.grow, this PR changes memory accesses to utilize a cached DataView (see also), where a try/catch can be and now is used to detect a detached buffer.

There is more that can be done here, like keeping track of where memory might actually grow, and if it's guaranteed to never grow in between two calls of the respective __get/setXY helpers access the DataView directly in subsequent calls. So far this is done where trivial, e.g. in some __lift/lowerXY helpers, but not yet in __lift/lowerRecord where it's a bit unclear whether the additional complexity would actually be worth it.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@dcodeIO dcodeIO marked this pull request as ready for review January 4, 2023 11:12
@dcodeIO dcodeIO merged commit a1434b2 into main Jan 4, 2023
@HerrCai0907 HerrCai0907 deleted the bindings-dataview branch October 17, 2023 09:00
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