Skip to content

[core] Add TGenericClassInfo::AdoptMemberStreamer()#20736

Merged
silverweed merged 3 commits intoroot-project:masterfrom
silverweed:genericclass_adoptmember
Feb 9, 2026
Merged

[core] Add TGenericClassInfo::AdoptMemberStreamer()#20736
silverweed merged 3 commits intoroot-project:masterfrom
silverweed:genericclass_adoptmember

Conversation

@silverweed
Copy link
Copy Markdown
Contributor

This Pull request:

adds a new function to TGenericClassInfo to allow deferring the registration of a MemberStreamer during static initialization. Performs a similar function to TGenericClassInfo::AdoptStreamer et al. but for TMemberStreamers.

Reason

Currently it's impossible to register a MemberStreamer of a class during static initialization without invoking TClass::GetClass, which should never be done at library loading time, as it causes issues.

Specifically, ALICE was hit by this after adding a GetClass in a static initializer and as a result observed huge performance regressions due to Cling being initialized earlier than intended (which in turn causes modules to be registered too early).

cc @ktf

Comment thread core/meta/src/TGenericClassInfo.cxx
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 17, 2025

Test Results

    21 files  ±  0      21 suites  ±0   3d 17h 8m 45s ⏱️ + 12h 24m 36s
 3 782 tests +  7   3 782 ✅ +  7  0 💤 ±0  0 ❌ ±0 
72 421 runs  +105  72 421 ✅ +105  0 💤 ±0  0 ❌ ±0 

Results for commit 01c68e3. ± Comparison against base commit 34efbdb.

♻️ This comment has been updated with latest results.

@silverweed silverweed force-pushed the genericclass_adoptmember branch from 8f74622 to c5e9f1d Compare December 17, 2025 07:35
@silverweed silverweed requested a review from pcanal December 17, 2025 07:35
Copy link
Copy Markdown
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Consider adding a test if practical.

@silverweed silverweed requested a review from bellenot as a code owner February 4, 2026 14:16
@silverweed silverweed force-pushed the genericclass_adoptmember branch from d48eec2 to 0ee83da Compare February 4, 2026 15:36
If the StreamerInfo is already compiled it will ignore a change in
member streamers, so we emit an error if one attempts to call
TClass::AdoptMemberStreamer in that situation.
This error propagates to TGenericClassInfo::AdoptMemberStreamer as well.
@silverweed silverweed force-pushed the genericclass_adoptmember branch from 0ee83da to 0d90cfb Compare February 5, 2026 08:51
Comment thread core/meta/inc/TClass.h Outdated
Comment thread core/meta/inc/TGenericClassInfo.h Outdated
@silverweed silverweed force-pushed the genericclass_adoptmember branch from 0d90cfb to f3b41d2 Compare February 5, 2026 08:57
Comment thread roottest/root/io/customStreamer/testMemberStreamer2.C
@silverweed silverweed force-pushed the genericclass_adoptmember branch from f3b41d2 to 01c68e3 Compare February 6, 2026 15:46
Copy link
Copy Markdown
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@silverweed silverweed merged commit 7c3c711 into root-project:master Feb 9, 2026
28 of 30 checks passed
@silverweed silverweed deleted the genericclass_adoptmember branch February 9, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants