Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NFC][ntuple] add clarifying comment in RVariantField
Browse files Browse the repository at this point in the history
jblomer committed Jun 3, 2024
1 parent b8cf2f9 commit 0cf959e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tree/ntuple/v7/src/RField.cxx
Original file line number Diff line number Diff line change
@@ -3281,6 +3281,8 @@ ROOT::Experimental::RVariantField::RVariantField(std::string_view fieldName,
fVariantOffset = dm->GetOffset();

const auto tagSize = GetVariantTagSize();
// To calculate the padding, we use the tag size as a substitute for the tag alignment, i.e. the next line
// calculates alignof(tagtype) - (fMaxItemSize % alignof(tagtype));
const auto padding = tagSize - (fMaxItemSize % tagSize);
fTagOffset = fVariantOffset + fMaxItemSize + ((padding == tagSize) ? 0 : padding);
}

0 comments on commit 0cf959e

Please sign in to comment.