Add support for platforms that don't allow unaligned memory access
Merge pull request #3289 from chrisvest/2.2-unaligned-access

[2.2] Add support for platforms that don't allow unaligned memory access