Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some ABIs pass structs containing a single element differently (and in a less performant way) than primitive data types.


You should always be aware of the details of whatever platform you're targeting, to be sure.

That said, can you name a few that work this way? If I've worked on such a platform, it's been a long while.


Apparently ARM64 does this for return values. I remembered the `#[repr(transparent)]` proposal that precisely tackled this problem for Rust: [RFC 1758](https://github.com/rust-lang/rfcs/blob/de0917dca549694fffbe3...).


Thanks, I'll dig in! Is this limited to floating point? That doesn't surprise me nearly as much.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: