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

fix: resource lifetimes #262

Merged
merged 2 commits into from
Nov 16, 2023
Merged

fix: resource lifetimes #262

merged 2 commits into from
Nov 16, 2023

Conversation

guybedford
Copy link
Collaborator

@guybedford guybedford commented Nov 16, 2023

This fixes a few minor edge cases around resource handling, resolves #243, #249.

  • We no longer null out Symbol.dispose when a resource has been disposed - instead we replace it with an empty function.
  • We now explicitly track drops for low-level function borrows, and throw a resource error if any of the borrows were not dropped before the end of the function call.
  • In the process, referring back to handle variables from earlier code output, I've updated the bindgen to use var over const where appropriate. In fact, it is known that using var has significant performance benefits over const in JS engines, so this can even be classed as a performance improvement.

@guybedford guybedford added this pull request to the merge queue Nov 16, 2023
Merged via the queue into main with commit 18c47bf Nov 16, 2023
6 checks passed
@guybedford guybedford deleted the double-dispose branch November 16, 2023 00:58
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.

Stream dispose multi-calls
1 participant