endian icon indicating copy to clipboard operation
endian copied to clipboard

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

Open manipuladordedados opened this issue 10 months ago • 1 comments

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?

manipuladordedados avatar Apr 04 '24 19:04 manipuladordedados

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.

pdimov avatar Apr 04 '24 23:04 pdimov