3 ms·
If you're willing to use compiler extensions, you can avoid the memcpy by using packed structs. This can generate better code. Folly has a generic `loadUnalign
by ot 10y ago
If you're willing to use compiler extensions, you can avoid the memcpy by using packed structs. This can generate better code.
Folly has a generic `loadUnaligned()` that uses this trick: https://github.com/facebook/folly/blob/5d52fb8c30e567403b8ccb65e5c1a159fb92d707/folly/Bits.h#L539 https://github.com/facebook/folly/blob/5d52fb8c30e567403b8cc...