Skip to content

neorados: avoid using std::aligned_storage_t#64037

Merged
tchaikov merged 1 commit intoceph:mainfrom
tchaikov:wip-neorados-alignedas
Jun 19, 2025
Merged

neorados: avoid using std::aligned_storage_t#64037
tchaikov merged 1 commit intoceph:mainfrom
tchaikov:wip-neorados-alignedas

Conversation

@tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Jun 19, 2025

std::aligned_storage_t was deprecated in C++23, to be prepared for it, let's use alignas for the same behavior. because we do not always pass a power-of-2 number to std::aligned_storage_t, while alignas() requires an alignment of power of 2. so we use std::bit_ceil() to calculate the minimum alignment greater or equal to the given number.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

std::aligned_storage_t was deprecated in C++23, to be prepared for
it, let's use alignas for the same behavior. because we do not always
pass a power-of-2 number to `std::aligned_storage_t`, while `alignas()`
requires an alignment of power of 2. so we use `std::bit_ceil()` to
calculate the minimum alignment greater or equal to the given number.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
@tchaikov tchaikov requested a review from adamemerson June 19, 2025 09:00
@tchaikov
Copy link
Contributor Author

@adamemerson hi Adam, could you please help review this change?

@tchaikov
Copy link
Contributor Author

jenkins test api

Copy link
Contributor

@adamemerson adamemerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

@tchaikov tchaikov merged commit ebceb95 into ceph:main Jun 19, 2025
26 checks passed
@tchaikov tchaikov deleted the wip-neorados-alignedas branch June 19, 2025 23:20
@cbodley
Copy link
Contributor

cbodley commented Nov 24, 2025

https://tracker.ceph.com/issues/73750 tracks a very strange crash in neorados tests which i managed to bisect back to this commit :(

@cbodley
Copy link
Contributor

cbodley commented Nov 24, 2025

https://tracker.ceph.com/issues/73750 tracks a very strange crash in neorados tests which i managed to bisect back to this commit :(

further rca in https://tracker.ceph.com/issues/73750#note-15, and a candidate fix in #66396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants