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

[mypyc] Don't free target of LoadMem too early #9299

Merged
merged 2 commits into from
Aug 13, 2020
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Aug 13, 2020

Add optional reference to the object from which we are reading from
to LoadMem so that the object won't be freed before we read memory.

Fixes mypyc/mypyc#756.

Add optional reference to the object from which we are reading from
to `LoadMem` so that the object won't be freed before we read memory.

Fixes mypyc/mypyc#756.
@JukkaL JukkaL requested a review from TH3CHARLie August 13, 2020 13:41
Copy link
Collaborator

@TH3CHARLie TH3CHARLie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Before merging this, please verify this branch on dropbox internal code that would crash on master to make sure this fix works.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Aug 13, 2020

I checked that this fixes the crash with Dropbox internal repositories.

@JukkaL JukkaL merged commit 049a879 into master Aug 13, 2020
@JelleZijlstra JelleZijlstra deleted the mypyc-refcount branch August 13, 2020 20:07
@TH3CHARLie
Copy link
Collaborator

This commit caused https://github.com/mypyc/mypyc-benchmark-results/blob/master/reports/benchmarks/nqueens.md a 6.4% performance downgrade.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Aug 14, 2020

...a 6.4% performance downgrade.

I will look at the generated code to see if there's anything suspicious that might have caused this. Since the benchmark is pretty small, 6.4% could also be just noise.

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.

Reference counting issue with GetElementPtr
2 participants