-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Record alignment of class in dictionary and use in TStreamerInfo #21669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pcanal
wants to merge
27
commits into
root-project:master
Choose a base branch
from
pcanal:tclass-alignof
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,181
−154
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
7f22e45
meta: Record alignment of class in dictionary
pcanal 9f51def
meta: Add alignment info for emulated collections
pcanal d180eb2
io: Micro-optimization in alignment calculation.
pcanal 02c6ed2
io: Factor out alignment operation
pcanal 1fe2306
meta: Use std::max_align_t instead of sizeof(void*)
pcanal d9e3f1d
io: Explicitly forbid collection with content aligned to more than 4096
pcanal cd144c3
meta: Add alignment info to TDataType
pcanal 6cde2b8
meta: Remove over alignment of emulated class
pcanal 42bc7e9
meta: Alignment extend code doc
pcanal 5aa8aa5
meta: Adjust reference file from better alignment
pcanal f5bbec6
meta: Take emulation header in consideration for alignment value
pcanal b3c24bc
meta: Factor out and standardize alignment assert.
pcanal b37eb3e
meta: Factor AlignUp function
pcanal 70b4f71
io: Remove TGenCollectionProxy::AlignedAllocator
pcanal 1fc7081
meta: Extend alignment asserts
pcanal 25e6a29
io: Factor alignment calc for NewArray and DeleteArrray
pcanal 5405baf
Meta: Alignment calc for non-current StreamerInfo
pcanal d624aed
io: Make missing alignment fatal
pcanal 9c634b2
io: BuildOld set alignment for numerical types
pcanal 68ad8eb
io: Add comment on TStreamerInfo size and alignment for non-current T…
pcanal 30bb666
io: Set alignment for empty classes
pcanal 4d9f534
meta: Implement TStreamerElement::GetAlignment.
pcanal d189cd6
io: Add proper alignment for base classes
pcanal 75a372d
io: Clarify error cases (missing alignment)
pcanal 12ceed0
io: Add comment about matching new and delete for alignment
pcanal 4d54267
meta: Add test of alignment recording
pcanal 556989c
NFC core/io: partial clang-formatting
pcanal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // @(#)root/foundation: | ||
| // Author: Philippe Canal, April 2026 | ||
|
|
||
| /************************************************************************* | ||
| * Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. * | ||
| * All rights reserved. * | ||
| * * | ||
| * For the licensing terms see $ROOTSYS/LICENSE. * | ||
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | ||
| *************************************************************************/ | ||
|
|
||
| #ifndef ROOT_RAlignmentUtils | ||
| #define ROOT_RAlignmentUtils | ||
|
|
||
| #include <cassert> | ||
| #include <cstddef> | ||
|
|
||
| namespace ROOT { | ||
| namespace Internal { | ||
|
|
||
| /// Return true if \p align is a valid C++ alignment value: strictly positive | ||
| /// and a power of two. This is the set of values accepted by | ||
| /// `::operator new[](n, std::align_val_t(align))`. | ||
| inline constexpr bool IsValidAlignment(std::size_t align) noexcept | ||
| { | ||
| return align > 0 && (align & (align - 1)) == 0; | ||
| } | ||
|
|
||
| /// Round \p value up to the next multiple of \p align. | ||
| /// \p align must be a power of two (asserted at runtime in debug builds). | ||
| template <typename T> | ||
| inline constexpr T AlignUp(T value, T align) noexcept | ||
| { | ||
| assert(IsValidAlignment(static_cast<std::size_t>(align))); // must be a power of two | ||
| return (value + align - 1) & ~(align - 1); | ||
| } | ||
|
|
||
| } // namespace Internal | ||
| } // namespace ROOT | ||
|
|
||
| #endif // ROOT_RAlignmentUtils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.