Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[struct_pack] Add support for big-endian platform #474

Merged
merged 32 commits into from
Oct 13, 2023

Conversation

poor-circle
Copy link
Collaborator

@poor-circle poor-circle commented Oct 11, 2023

Why

Closes #436

What is changing

Add support for big-endian platform.

struct_pack will save data as little-endian in any platform. So run struct_pack in big-endian will slower than little-endian.
The zero-copy (std::string_view, std::span, struct_pack::trivial_view) is also limited in big-endian when byte width > 1.

Example

@poor-circle poor-circle changed the title [struct_pack] Add support for big-endian [struct_pack] Add support for big-endian platform Oct 11, 2023
include/ylt/struct_pack/endian_wrapper.hpp Outdated Show resolved Hide resolved
include/ylt/struct_pack/endian_wrapper.hpp Outdated Show resolved Hide resolved
include/ylt/struct_pack/endian_wrapper.hpp Outdated Show resolved Hide resolved
include/ylt/struct_pack/endian_wrapper.hpp Outdated Show resolved Hide resolved
include/ylt/struct_pack/packer.hpp Outdated Show resolved Hide resolved
include/ylt/struct_pack/unpacker.hpp Outdated Show resolved Hide resolved
include/ylt/struct_pack/unpacker.hpp Outdated Show resolved Hide resolved
@poor-circle poor-circle merged commit 71692db into alibaba:main Oct 13, 2023
30 checks passed
poor-circle added a commit to poor-circle/yalantinglibs that referenced this pull request Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[struct_pack] Crossplatform support?
2 participants