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

Does p in endian_load()/endian_store() needs to point to a T-aligned region? #51

Open
manipuladordedados opened this issue Apr 4, 2024 · 1 comment

Comments

@manipuladordedados
Copy link

Documentation doesn't state this requirement clearly. Furthermore, these functions are part of the header conversion.hpp for which documentation states that alignment is required. I think it's correct to assume that T is aligned, but not p (otherwise I'd have to create an extra buffer and perform an extra memcpy for no good reason). What is the requirement for these functions?

@pdimov
Copy link
Member

pdimov commented Apr 4, 2024

No, p doesn't need to be aligned. Unless otherwise specified, a pointer to unsigned char doesn't have alignment requirements (because the alignment of unsigned char is always 1.)

I'll make this explicit in the documentation.

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

No branches or pull requests

2 participants