Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-50

Remove undefined behavior w.r.t. unaligned memory accesses from bson headers

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              acm Andrew Morrow
              Reporter:
              acm Andrew Morrow
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: