-
Notifications
You must be signed in to change notification settings - Fork 277
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
u128
/i128
support in FFI
#2622
Comments
here is the tracking issue. As far as I see #[repr(C)]
struct U128(u64, u64); #[repr(C)] // Note that I haven't used `repr(transparent)`
struct U128([u64; 2]) Idk if there is any difference between the two. The only potential difference that I can think of is that of the calling convention In 2. I have used |
There are many C compilers and even more compilers that assume C-ABI behaviour. I would very much prefer the first option, unless there was a good reason to use the second syntax. In a vacuum (i.e. without ABI considerations) the first syntax is more explicit about the fact that you should really destructure both and use both parts of the value. You also don't add the baggage of |
No code currently relies on this, but if it did it would be a bug. |
Then it's really good that this is a WIP, rather than in production. If we're labelling hypotheticals as bugs, we should add the QA-confirmed tag to all issues. |
Signed-off-by: Shanin Roman <[email protected]>
Signed-off-by: Shanin Roman <[email protected]>
Signed-off-by: Shanin Roman <[email protected]>
Signed-off-by: Shanin Roman <[email protected]>
Signed-off-by: Shanin Roman <[email protected]>
Signed-off-by: Shanin Roman <[email protected]>
Signed-off-by: Shanin Roman <[email protected]>
The implementation after #2625 is outright wrong.
u128
/i128
is not FFI safe and cannot be sent across without serialization. I propose it to be serialized asFfiTuple2(u64, u64)
or[u64; 2]
The text was updated successfully, but these errors were encountered: