-
Notifications
You must be signed in to change notification settings - Fork 21
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
Token payload freed with after delay #124
Conversation
|
I think this means there is still a problem. Do the numbers change with the length of the run? |
No. it seems static. I will try to poke a little more at it and update here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as i could tell the only actual change is in the _lf_free_token
where the condition for freeing the value is changed. I don't fully understand how it changes the behaviour though.
The difference is that the payload gets freed when token->ok_to_free == no. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
There is still more work to do to get a clean valgrind report. Specifically, there is memory that is allocated at initialization time that never gets freed. I will keep working in this branch to attempt to address these issues, even though these are less critical and will only become a real issue when mutations are supported. |
This PR fixes a logic error where the payload of a token was not being freed when the token itself was not freed. A token is not freed if it is the "template" token for a port or action because it contains type information for that port or action and it will be reused in future events for that port or action. However, the payload, the value field, should be freed when it is no longer needed. This was not being done. This bug was probably introduced with the Python target, where payloads never get freed because the payload is a Python target and Python handles garbage collection.