[ntuple] Fixes for alignment#22312
Conversation
bb61c3d to
694bd02
Compare
694bd02 to
27ddc85
Compare
Fixes RNTuple alignment of classes whose alignment is determined by a transient member.
27ddc85 to
ba94832
Compare
Test Results 16 files 16 suites 2d 8h 34m 9s ⏱️ Results for commit ba94832. ♻️ This comment has been updated with latest results. |
| return (value + align - 1) & ~(align - 1); | ||
| } | ||
|
|
||
| /// Storage type whose alignment matches \a Align bytes. |
There was a problem hiding this comment.
| /// Storage type whose alignment matches \a Align bytes. | |
| /// Storage type whose alignment matches \a AlignT bytes. |
| #endif // _MSC_VER | ||
| } | ||
|
|
||
| inline bool IsPowerOfTwo(std::uint64_t v) |
There was a problem hiding this comment.
You may (or may not) want to use this in IsValidAlignment (which is only different as it reject 0)
|
|
||
| void ROOT::RFieldBase::EnsureValidAlignment(std::size_t alignment) | ||
| { | ||
| if (alignment == 0 || alignment > ROOT::RFieldBase::kMaxAlignment || !ROOT::Internal::IsPowerOfTwo(alignment)) |
There was a problem hiding this comment.
This is similar (but different) to ROOT::Internal::IsValidAlignment.
| if (alignment == 0 || alignment > ROOT::RFieldBase::kMaxAlignment || !ROOT::Internal::IsPowerOfTwo(alignment)) | |
| if (!ROOT::Internal::IsValidAlignment(alignment) || alignment > ROOT::RFieldBase::kMaxAlignment) |
At least in the main I/O part the limitation to 4096 is only for std::vector because they can be handled without dictionary (but then we need to explicitly handle the alignment of their content.
Is RNTuple more restrictive (i.e. calling an generically provided call to new for various alignment?)
Use the new
TClassalignment information where applicable. This fixesAdditionally, use the
newanddeleteoperators with alignment info. This ensures correct memory allocation for over-aligned types.Fixes #16765