Fix leaks in FxA FFI #89
Merged
Conversation
|
This is looking very good, thanks for taking the time to do this Thom. |
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.
As discussed in the standup we'd rather do this sooner than later because we might have to land the FxA bindings into android-components instead of in our monorepo.
Specifically we leaked all the strings that were returned as parts of repr(C) objects, and we leaked every Result.
This also updates it to be more like how mentat's FFI is coming along, although it goes a step further and makes handle panic from application code (if rust code panics across the FFI boundary it's undefined behavior).
And because this whole FFI thing has stressed me out immensely, and because I have basically nothing better to do, I did it this evening. IDK.
The Android part of this is thomcc@b0021de (the branch is https://github.com/thomcc/application-services/tree/sand). It's applies on top of @carolkng's patch, merges these changes in, and completes the android bindings to the FFI (so that I don't have to come back for them :P).
I don't think I can submit a PR on a branch that is off another branch without confusing github (I tried and it wanted me to be PRing the whole diff), so... yeah. It's in a separate branch instead of something else.