[SERVER-14852] Create endian- and alignment-agnostic abstractions for reading and writing data Created: 11/Aug/14  Updated: 17/Mar/15  Resolved: 26/Sep/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 2.7.4
Fix Version/s: 2.7.7

Type: Improvement Priority: Major - P3
Reporter: Mira Carey Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-1625 Make core server work on big-endian (... Closed
is depended on by SERVER-1811 ARM support Closed
Related
is related to SERVER-14853 Port networking library to AAE read/w... Closed
is related to SERVER-17629 Implement BoundedDataCursor/DataRange... Closed
Tested
Participants:

 Description   

We lack a fundamental read/write primitive for the server which provides an endian and alignment safe cross platform abstraction. I.e. one which swabs bytes where necessary and reads/writes via memcpy rather than reinterpret_cast.

This is needed to:

  • remove undefined behavior in the server
  • enable builds on big endian architectures
  • enable builds on architectures with strict alignment access
  • remove -fno-strict-aliasing from server compilation flags


 Comments   
Comment by Githook User [ 12/Aug/14 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'hanumantmk@gmail.com'}

Message: SERVER-14852 AAE safe read/write primitives

Alignment, aliasing and endian safe read write primitives in the form
of DataView and DataCursor primitives. These primitives provide safe
reads and writes with explicit endian variants that funnel through
std::memcpy to provide defined behavior.

Support for a safe packed struct idiom is also provided in the
encoded_value_storage class.
Branch: master
https://github.com/mongodb/mongo/commit/8d0bf7dfbfafd09b9465feec3651cdd31aeb0dcc

Generated at Thu Feb 08 03:36:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.