@@ -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,10 @@ 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+ {
608+ }
609+
612610void ROOT::RClassField::RClassDeleter::operator ()(void *objPtr, bool dtorOnly)
613611{
614612 fClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -860,6 +858,11 @@ void ROOT::Experimental::RSoAField::ConstructValue(void *where) const
860858 fSoAClass ->New (where);
861859}
862860
861+ ROOT ::Experimental::RSoAField::RSoADeleter::RSoADeleter(TClass *cl)
862+ : RDeleter(cl->GetClassAlignment ()), fSoAClass(cl)
863+ {
864+ }
865+
863866void ROOT::Experimental::RSoAField::RSoADeleter::operator ()(void *objPtr, bool dtorOnly)
864867{
865868 fSoAClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -1190,6 +1193,23 @@ std::unique_ptr<ROOT::RFieldBase::RDeleter> ROOT::RProxiedCollectionField::GetDe
11901193 return std::make_unique<RProxiedCollectionDeleter>(fProxy );
11911194}
11921195
1196+ ROOT ::RProxiedCollectionField::RProxiedCollectionDeleter::RProxiedCollectionDeleter(
1197+ std::shared_ptr<TVirtualCollectionProxy> proxy)
1198+ : RDeleter(proxy->GetCollectionClass ()->GetClassAlignment())
1199+ , fProxy(proxy)
1200+ {
1201+ }
1202+
1203+ ROOT ::RProxiedCollectionField::RProxiedCollectionDeleter::RProxiedCollectionDeleter(
1204+ std::shared_ptr<TVirtualCollectionProxy> proxy, std::unique_ptr<RDeleter> itemDeleter, size_t itemSize)
1205+ : RDeleter(proxy->GetCollectionClass ()->GetClassAlignment())
1206+ , fProxy(proxy)
1207+ , fItemDeleter(std::move(itemDeleter))
1208+ , fItemSize(itemSize)
1209+ {
1210+ fIFuncsWrite = RCollectionIterableOnce::GetIteratorFuncs (fProxy .get (), false /* readFromDisk */ );
1211+ }
1212+
11931213void ROOT::RProxiedCollectionField::RProxiedCollectionDeleter::operator ()(void *objPtr, bool dtorOnly)
11941214{
11951215 if (fItemDeleter ) {
@@ -1415,6 +1435,11 @@ void ROOT::RStreamerField::ConstructValue(void *where) const
14151435 fClass ->New (where);
14161436}
14171437
1438+ ROOT ::RStreamerField::RStreamerFieldDeleter::RStreamerFieldDeleter(TClass *cl)
1439+ : RDeleter(cl->GetClassAlignment ()), fClass(cl)
1440+ {
1441+ }
1442+
14181443void ROOT::RStreamerField::RStreamerFieldDeleter::operator ()(void *objPtr, bool dtorOnly)
14191444{
14201445 fClass ->Destructor (objPtr, true /* dtorOnly */ );
@@ -1816,7 +1841,7 @@ std::unique_ptr<ROOT::RFieldBase::RDeleter> ROOT::RVariantField::GetDeleter() co
18161841 for (const auto &f : fSubfields ) {
18171842 itemDeleters.emplace_back (GetDeleterOf (*f));
18181843 }
1819- return std::make_unique<RVariantDeleter>(fTagOffset , fVariantOffset , std::move (itemDeleters));
1844+ return std::make_unique<RVariantDeleter>(fTagOffset , fVariantOffset , GetAlignment (), std::move (itemDeleters));
18201845}
18211846
18221847size_t ROOT::RVariantField::GetAlignment () const
0 commit comments