Repository navigation
Conversation
…ef and the defs that fill it
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.
--memnow says how each region is freed and who fills it.frees: eachx.free()on a handled region (kind: manual,at), then the drop the protocol runs at the end of the handle's block (kind: auto,when: blockEnd,ifLive: true:Emit.dropscalls the drop op only when the region is still live). Afree()on a{}Region param hasregion: null, itsdefandparam(the caller passes the region).regions[]gaindef(the def that handles it) anddefs(the defs whose sites fill it, in order of first site): region sharing.sites[]gaindef.Mem finds the frees with a walk over the fn bodies (
Mem.manualFrees); a free belongs to the region of its def handled as the same name on an earlier line, else it is a param free.New test
tests/s2/mem/frees.srs: a region freed by hand then dropped, a region filled by two defs, a region with no sites, a param free. Checked by hand against the source; the program runs and prints 10.Checks:
tests/s2/mem/*.outare unchanged (jq drops the new fields and compares).--mem1,405,420,910 -> 1,409,850,176 (+0.32%).Mutants (each builds):
l < line)freexdefskeeps duplicates