[SERVER-60787] Replace WithAlignment inheritance with std::aligned_storage Created: 18/Oct/21  Updated: 29/Oct/23  Resolved: 22/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-59680 Partition the cache to avoid a bottle... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2021-11-01
Participants:
Story Points: 1

 Description   

WithAlignment<T> is an unnecessary and confusing feature of util that we can get rid of. It has T as a base class, which means it can't be used with arrays, primitive types, or final classes, and its constructor overload set is imperfect, and can't do aggregate initialization.

We can easily replace the 2 users of this thing with std::aligned_storage instead.



 Comments   
Comment by Githook User [ 22/Oct/21 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-60787 Force alignment with std::aligned_storage not inheritance
Branch: master
https://github.com/mongodb/mongo/commit/bc2ae9aa30c2b3fff3471687678752bb01000113

Comment by Billy Donahue [ 18/Oct/21 ]

(came up in Code Review for SERVER-59680)

Generated at Thu Feb 08 05:50:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.