endian
endian copied to clipboard
Does p in endian_load()/endian_store() needs to point to a T-aligned region?
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?
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.