Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Comments

feat: enforce little-endianness for folly::Bits<> storage#2484

Open
mhx wants to merge 1 commit intofacebook:mainfrom
mhx:mhx/bits-force-little-endian
Open

feat: enforce little-endianness for folly::Bits<> storage#2484
mhx wants to merge 1 commit intofacebook:mainfrom
mhx:mhx/bits-force-little-endian

Conversation

@mhx
Copy link
Contributor

@mhx mhx commented Aug 6, 2025

The inline docs for folly::Bits already mention that storage is expected to be little-endian. This change enforces little-endianness by using folly::Endian for load/store operations. This should be a no-op on little-endian systems.

The main motivation for this change is that it immediately enables fbthrift Frozen2 files to be exchanged between little- and big-endian systems.

@meta-cla meta-cla bot added the CLA Signed label Aug 6, 2025
@mhx mhx force-pushed the mhx/bits-force-little-endian branch from 23aa467 to 3166f8b Compare August 12, 2025 08:42
@mhx
Copy link
Contributor Author

mhx commented Aug 12, 2025

Updated to simplify the change and leave the BitsTraits untouched. Also fixed the unit tests on big-endian systems, which were previously broken.

The inline docs for `folly::Bits` already mention that storage is expected
to be little-endian. This change enforces little-endianness by using
`folly::Endian` for load/store operations. This should be a no-op on
little-endian systems.

The main motivation for this change is that it immediately enables
fbthrift Frozen2 files to be exchanged between little- and big-endian
systems.
@mhx mhx force-pushed the mhx/bits-force-little-endian branch from 77fd997 to 37cbf2e Compare February 6, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant