Buffer protocol updates to support object references, custom release method#772
Merged
kngwyu merged 2 commits intoPyO3:masterfrom Feb 21, 2020
Merged
Buffer protocol updates to support object references, custom release method#772kngwyu merged 2 commits intoPyO3:masterfrom
kngwyu merged 2 commits intoPyO3:masterfrom
Conversation
…ures to pass PyClassShell Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Member
|
Thank you.
So you mean this PR enables The only concern is the conflict with #770, but I can fix it myself. |
kngwyu
approved these changes
Feb 21, 2020
|
|
||
| { | ||
| let _py = Python::acquire_gil().python(); | ||
| drop(buf); |
Contributor
Author
|
@kngwyu That's great, yes I was also concerned about the conflict with that other PR. Incidentally, my use case is a memory buffer with a private key which I want to zero out as soon as there's no more references to it, but not before then. |
Member
|
Thank you! |
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.
This PR doesn't cover the buffer refactoring mentioned in #657 for example, but it allows for implementors to avoid having the exporter dropped while Python is holding a memoryview referencing it. Leaving as a draft because I'm not sure what the impact would be on existing implementations.