@@ -117,12 +117,6 @@ TEnum *EnsureValidEnum(std::string_view enumName)
117117 return e;
118118}
119119
120- void EnsureValidAlignment (std::size_t align)
121- {
122- if (align == 0 || align > ROOT ::RFieldBase::kMaxAlignment || !ROOT::Internal::IsPowerOfTwo (align))
123- throw ROOT::RException (R__FAIL (std::string (" invalid alignment: " ) + std::to_string (align)));
124- }
125-
126120// / Create a comma-separated list of type names from the given fields. Uses either the real type names or the
127121// / type aliases (if there are any, otherwise the actual type name). Used to construct template argument lists
128122// / for templated types such as std::pair<...>, std::tuple<...>, std::variant<...>.
@@ -608,6 +602,8 @@ void ROOT::RClassField::ConstructValue(void *where) const
608602 fClass ->New (where);
609603}
610604
605+ ROOT ::RClassField::RClassDeleter::RClassDeleter(TClass *cl) : RDeleter(cl->GetClassAlignment ()), fClass(cl) {}
606+
611607void ROOT::RClassField::RClassDeleter::operator ()(void *objPtr, bool dtorOnly)
612608{
613609 fClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -859,6 +855,10 @@ void ROOT::Experimental::RSoAField::ConstructValue(void *where) const
859855 fSoAClass ->New (where);
860856}
861857
858+ ROOT ::Experimental::RSoAField::RSoADeleter::RSoADeleter(TClass *cl) : RDeleter(cl->GetClassAlignment ()), fSoAClass(cl)
859+ {
860+ }
861+
862862void ROOT::Experimental::RSoAField::RSoADeleter::operator ()(void *objPtr, bool dtorOnly)
863863{
864864 fSoAClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -1189,6 +1189,22 @@ std::unique_ptr<ROOT::RFieldBase::RDeleter> ROOT::RProxiedCollectionField::GetDe
11891189 return std::make_unique<RProxiedCollectionDeleter>(fProxy );
11901190}
11911191
1192+ ROOT ::RProxiedCollectionField::RProxiedCollectionDeleter::RProxiedCollectionDeleter(
1193+ std::shared_ptr<TVirtualCollectionProxy> proxy)
1194+ : RDeleter(proxy->GetCollectionClass ()->GetClassAlignment()), fProxy(proxy)
1195+ {
1196+ }
1197+
1198+ ROOT ::RProxiedCollectionField::RProxiedCollectionDeleter::RProxiedCollectionDeleter(
1199+ std::shared_ptr<TVirtualCollectionProxy> proxy, std::unique_ptr<RDeleter> itemDeleter, size_t itemSize)
1200+ : RDeleter(proxy->GetCollectionClass ()->GetClassAlignment()),
1201+ fProxy(proxy),
1202+ fItemDeleter(std::move(itemDeleter)),
1203+ fItemSize(itemSize)
1204+ {
1205+ fIFuncsWrite = RCollectionIterableOnce::GetIteratorFuncs (fProxy .get (), false /* readFromDisk */ );
1206+ }
1207+
11921208void ROOT::RProxiedCollectionField::RProxiedCollectionDeleter::operator ()(void *objPtr, bool dtorOnly)
11931209{
11941210 if (fItemDeleter ) {
@@ -1414,6 +1430,11 @@ void ROOT::RStreamerField::ConstructValue(void *where) const
14141430 fClass ->New (where);
14151431}
14161432
1433+ ROOT ::RStreamerField::RStreamerFieldDeleter::RStreamerFieldDeleter(TClass *cl)
1434+ : RDeleter(cl->GetClassAlignment ()), fClass(cl)
1435+ {
1436+ }
1437+
14171438void ROOT::RStreamerField::RStreamerFieldDeleter::operator ()(void *objPtr, bool dtorOnly)
14181439{
14191440 fClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -1815,7 +1836,7 @@ std::unique_ptr<ROOT::RFieldBase::RDeleter> ROOT::RVariantField::GetDeleter() co
18151836 for (const auto &f : fSubfields ) {
18161837 itemDeleters.emplace_back (GetDeleterOf (*f));
18171838 }
1818- return std::make_unique<RVariantDeleter>(fTagOffset , fVariantOffset , std::move (itemDeleters));
1839+ return std::make_unique<RVariantDeleter>(fTagOffset , fVariantOffset , GetAlignment (), std::move (itemDeleters));
18191840}
18201841
18211842size_t ROOT::RVariantField::GetAlignment () const
0 commit comments