-
Type: Improvement
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: None
-
Component/s: Portability
The BSON headers (and some others) currently read and write arbitrary memory locations casted to types with alignment requirements. This is undefined behavior, and is non-portable to some architectures.
We should replace these unaligned accesses with suitable memcpy calls, and trust in compiler QoI to turn those memcpy calls into intrinsics when applicable on the target platform.