Skip to content

What about: "odd" pointer sizes #255

@RalfJung

Description

@RalfJung

@chorman0773 brings up the issue of platforms where pointers have "strange" sizes, such as 3 bytes.

if Rust wants to support such platforms, interesting questions arise:

  • Is size_of::<*const ()> == 3? That seems like the most obvious choice, but @chorman0773's comment indicates C makes the size 4 and the highest byte is somehow "dead". Not sure why a size of 4 would be reasonable though, if there are only 3 bytes of data.
  • Is usize a magic u24, or is it u32 and usize-to-ptr casts truncate, or something else?

I am probably also missing some aspects of this due to a lack of familiarity with such platforms. :)
This seems somewhat related to #29 in that it is about "strange platforms".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions