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

Consolidate/Simplify the foreign bindings handlemap code #1969

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

bendk
Copy link
Contributor

@bendk bendk commented Jan 29, 2024

I'm trying to get #1823 merged now that 0.26.0 is out, but I'll break it up a bit to make it easier. The first step is consolidating the foreign handle map code.

Foreign languages now define 1 handle map and use it for all object types. I tried to simplify the handle map implementations, the had a lot of features that we weren't using at all and seemed to be only half-implemented to me, like the right map and counter map.

Handles are always u64 values. This allows us to remove some code like the USize handling on Kotlin and the
FfiType::RustFutureContinuationData variant.

@bendk bendk requested a review from mhammond January 29, 2024 23:08
@bendk bendk requested a review from a team as a code owner January 29, 2024 23:08
@bendk bendk force-pushed the consolidate-handlemaps branch 2 times, most recently from 34b3277 to b2637a8 Compare January 29, 2024 23:48
CHANGELOG.md Outdated
@@ -16,6 +16,7 @@

- The callback interface code was reworked to use vtables rather than a single callback method.
See https://github.com/mozilla/uniffi-rs/pull/1818 for details and how the other bindings were updated.
- Removed `FfiType::RustFutureContinuationData`. `RustFutureContinuation` callbacks now a `u64` handle.
Copy link
Member

Choose a reason for hiding this comment

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

nit: that 2nd sentence isn't very clear - I think just missing "take"?

@bendk bendk force-pushed the consolidate-handlemaps branch 2 times, most recently from 75ee8c9 to 1240333 Compare January 30, 2024 18:11
I'm trying to get mozilla#1823 merged now that 0.26.0 is out, but I'll break it
up a bit to make it easier.  The first step is consolidating the foreign
handle map code.

Foreign now languages define 1 handle map and use it for all object
types. I tried to simplify the handle map implementations, the had a lot
of features that we weren't using at all and seemed to be only
half-implemented to me, like the right map and counter map.

Handles are always `u64` values.  This allows us to remove some code
like the `USize` handling on Kotlin and the
`FfiType::RustFutureContinuationData` variant.
@bendk bendk merged commit 132635c into mozilla:main Jan 30, 2024
0 of 4 checks passed
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.

2 participants