Repository navigation
Sema: the retention window — a callable retained as callback userdata is a live view while its resource is used (§16.2b.9) - #1696
Merged
Conversation
…e its resource is used (§16.2b.9 retention window, #1652 follow-up) Eric's ruling: the retained userdata is the callable's own mutating view of its captured places, held by the resource until reset, destruction or its last callback-capable operation, so the sink cannot be touched inside that window. Sema now records, at a pair userdata setter call with plain locals on both sides, that the resource retains the callable; the three view-liveness paths (the read check, the mutation check, the statement-end sweep) treat a use of the resource as a use of the view. Reading the sink between the setter and the run is refused by #1691's check; after the run it is ordinary.
Contributor
Author
|
Seed-driven battery at 0b55abc (seed nightly-20260925-local-1, WITH=src/main), this host: |
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.
Follow-up to #1679 under Eric's ruling (D66 amendment, #1692): a local handed to a pair's userdata setter stays a live view for as long as the retaining resource is used, so a read of the sink between the setter and
run/performis refused by #1694's check (fixture:err_c_facade_variadic_callback_sink_read_in_window.w); the check-only shapes fixture now reads the sink after the run. Runtime libcurl fixtures unchanged. Draft until the battery is green.