Skip to content

Conversation

@CryZe
Copy link
Contributor

@CryZe CryZe commented Aug 23, 2024

Various architectures have native support for 64-bit integers, but there are Rust targets for those architectures where the pointer size is intentionally just 32-bit. For SWAR this smaller pointer size would negatively affect those targets, so this PR ensures the chunk size stays 64-bit on those targets.

The same is done in various other crates, such as hashbrown. Though I wish there was some sort of #[cfg(target_integer_width = "64")].

Various architectures have support for 64-bit integers, but there are Rust targets for those architectures where the pointer size is intentionally just 32-bit. For SWAR this smaller pointer size would negatively affect those targets, so this PR ensures the chunk size stays 64-bit on those targets.
@purplesyringa
Copy link
Contributor

For context:

  • aarch64 is for target aarch64-unknown-linux-gnu_ilp32
  • x86_64 is for target x86_64-unknown-linux-gnux32

WASM's self-explanatory.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@dtolnay dtolnay merged commit fec0376 into serde-rs:master Aug 23, 2024
@CryZe CryZe deleted the chunk-64bit branch August 23, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants