Introduce the memory neutrality property - #752
Merged
Merged
Conversation
Heizmann
force-pushed
the
mh/memory_neutrality
branch
2 times, most recently
from
October 6, 2025 02:34
d8c5b44 to
00a6a7b
Compare
schuessf
reviewed
Oct 6, 2025
schuessf
left a comment
Member
There was a problem hiding this comment.
Thank you for improving our settings!
I have left a few (mostly minor) comments.
schuessf
reviewed
Oct 6, 2025
Heizmann
added a commit
that referenced
this pull request
Oct 7, 2025
Heizmann
added a commit
that referenced
this pull request
Oct 7, 2025
Heizmann
added a commit
that referenced
this pull request
Oct 7, 2025
Heizmann
added a commit
that referenced
this pull request
Oct 7, 2025
Member
|
Looks good now, I will approve if the nightly succeeds. |
bahnwaerter
approved these changes
Oct 7, 2025
schuessf
approved these changes
Oct 8, 2025
We call a function *memory neutral* if all memory that was dynamically allocated is freed before the function returns. This commit addresses the following problems: * The term allocation purity that we used in the past is a misnomer. Allocation purity means that a function does not allocate memory dynamically. * We have a setting that checks whether the main function is memory neutral and a setting that checks whether some function is memory neutral. These settings interfere with each other. (What if the check for all functions is set but the check for main is not set?) * Users usually do not want to check whether all functions are memory neutral, but users might want to know whether some specific function is memory neutral. Solution: Replace both settings with one new setting in which users specify a list of functions for which memory neutrality is checked.
Applied the following commands.
find . -name "*.epf" -type f -exec sed -i 's#cacsl2boogietranslator/Check\\ for\\ the\\ main\\ procedure\\ if\\ all\\ allocated\\ memory\\ was\\ freed=true#cacsl2boogietranslator/Check\\ memory\\ neutrality=main#g' {} \;
find . -name "*.epf" -type f -exec sed -i 's#cacsl2boogietranslator/Check\\ for\\ the\\ main\\ procedure\\ if\\ all\\ allocated\\ memory\\ was\\ freed=false#cacsl2boogietranslator/Check\\ memory\\ neutrality=#g' {} \;
Update all epfs that contain allocation purity manually
Heizmann
force-pushed
the
mh/memory_neutrality
branch
from
October 9, 2025 00:09
290ed92 to
07392df
Compare
Heizmann
added a commit
that referenced
this pull request
Oct 9, 2025
Heizmann
added a commit
that referenced
this pull request
Oct 9, 2025
Heizmann
added a commit
that referenced
this pull request
Oct 9, 2025
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.
We call a function memory neutral if all memory that was dynamically allocated is freed before the function returns.
This commit addresses the following problems:
Solution:
Replace both settings with one new setting in which users specify a list of functions for which memory neutrality is checked.