@@ -118,12 +118,6 @@ TEnum *EnsureValidEnum(std::string_view enumName)
118118 return e;
119119}
120120
121- void EnsureValidAlignment (std::size_t align)
122- {
123- if (align == 0 || align > ROOT ::RFieldBase::kMaxAlignment || !ROOT::Internal::IsPowerOfTwo (align))
124- throw ROOT::RException (R__FAIL (std::string (" invalid alignment: " ) + std::to_string (align)));
125- }
126-
127121// / Create a comma-separated list of type names from the given fields. Uses either the real type names or the
128122// / type aliases (if there are any, otherwise the actual type name). Used to construct template argument lists
129123// / for templated types such as std::pair<...>, std::tuple<...>, std::variant<...>.
@@ -609,6 +603,8 @@ void ROOT::RClassField::ConstructValue(void *where) const
609603 fClass ->New (where);
610604}
611605
606+ ROOT ::RClassField::RClassDeleter::RClassDeleter(TClass *cl) : RDeleter(cl->GetClassAlignment ()), fClass(cl) {}
607+
612608void ROOT::RClassField::RClassDeleter::operator ()(void *objPtr, bool dtorOnly)
613609{
614610 fClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -860,6 +856,10 @@ void ROOT::Experimental::RSoAField::ConstructValue(void *where) const
860856 fSoAClass ->New (where);
861857}
862858
859+ ROOT ::Experimental::RSoAField::RSoADeleter::RSoADeleter(TClass *cl) : RDeleter(cl->GetClassAlignment ()), fSoAClass(cl)
860+ {
861+ }
862+
863863void ROOT::Experimental::RSoAField::RSoADeleter::operator ()(void *objPtr, bool dtorOnly)
864864{
865865 fSoAClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -1190,6 +1190,22 @@ std::unique_ptr<ROOT::RFieldBase::RDeleter> ROOT::RProxiedCollectionField::GetDe
11901190 return std::make_unique<RProxiedCollectionDeleter>(fProxy );
11911191}
11921192
1193+ ROOT ::RProxiedCollectionField::RProxiedCollectionDeleter::RProxiedCollectionDeleter(
1194+ std::shared_ptr<TVirtualCollectionProxy> proxy)
1195+ : RDeleter(proxy->GetCollectionClass ()->GetClassAlignment()), fProxy(proxy)
1196+ {
1197+ }
1198+
1199+ ROOT ::RProxiedCollectionField::RProxiedCollectionDeleter::RProxiedCollectionDeleter(
1200+ std::shared_ptr<TVirtualCollectionProxy> proxy, std::unique_ptr<RDeleter> itemDeleter, size_t itemSize)
1201+ : RDeleter(proxy->GetCollectionClass ()->GetClassAlignment()),
1202+ fProxy(proxy),
1203+ fItemDeleter(std::move(itemDeleter)),
1204+ fItemSize(itemSize)
1205+ {
1206+ fIFuncsWrite = RCollectionIterableOnce::GetIteratorFuncs (fProxy .get (), false /* readFromDisk */ );
1207+ }
1208+
11931209void ROOT::RProxiedCollectionField::RProxiedCollectionDeleter::operator ()(void *objPtr, bool dtorOnly)
11941210{
11951211 if (fItemDeleter ) {
@@ -1415,6 +1431,11 @@ void ROOT::RStreamerField::ConstructValue(void *where) const
14151431 fClass ->New (where);
14161432}
14171433
1434+ ROOT ::RStreamerField::RStreamerFieldDeleter::RStreamerFieldDeleter(TClass *cl)
1435+ : RDeleter(cl->GetClassAlignment ()), fClass(cl)
1436+ {
1437+ }
1438+
14181439void ROOT::RStreamerField::RStreamerFieldDeleter::operator ()(void *objPtr, bool dtorOnly)
14191440{
14201441 fClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -1816,7 +1837,7 @@ std::unique_ptr<ROOT::RFieldBase::RDeleter> ROOT::RVariantField::GetDeleter() co
18161837 for (const auto &f : fSubfields ) {
18171838 itemDeleters.emplace_back (GetDeleterOf (*f));
18181839 }
1819- return std::make_unique<RVariantDeleter>(fTagOffset , fVariantOffset , std::move (itemDeleters));
1840+ return std::make_unique<RVariantDeleter>(fTagOffset , fVariantOffset , GetAlignment (), std::move (itemDeleters));
18201841}
18211842
18221843size_t ROOT::RVariantField::GetAlignment () const
0 commit comments