]> wimlib.net Git - wimlib/commit
Use memcpy() for unaligned accesses
authorEric Biggers <ebiggers3@gmail.com>
Fri, 22 May 2020 05:35:29 +0000 (22:35 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 22 May 2020 05:42:40 +0000 (22:42 -0700)
commit2c18108561c0c3a8076e1ae29d76ce372e0fcb34
tree9c86f78dd22f1a930291b1ff99d38d6dc34fcfcb
parentbdd51aef6914cd585f86b0404ef5e8bb2c1c8eab
Use memcpy() for unaligned accesses

For unaligned memory accesses, with modern compilers memcpy() is
compiled just as efficiently as __attribute__((packed)).  This also
avoids using a nonstandard extension and potentially running into the
gcc 10 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94994.
include/wimlib/unaligned.h