Skip to content

i128/u128 are not FFI safe #119

Closed
Closed
@gnzlbg

Description

@gnzlbg

The layout of i128/u128 appears to currently be not fully specified due to: rust-lang/rust#54341 and these types are indeed not safe to use in Rust FFI.

We probably want to guarantee that their layout matches __int128 and similar C language extensions in the platforms that expose them, and to say that their alignment is "implementation-defined" in platforms that do not expose these, probably documenting what it is, at least on Tier-1 platforms like Windows msvc targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ffiTopic: Related to FFIA-layoutTopic: Related to data structure layout (`#[repr]`)C-open-questionCategory: An open question that we should revisit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions