[geom] Fix Windows linkage for shape TLS access - #3
Merged
sawenzel merged 1 commit intoSep 3, 2026
Merged
Conversation
TGeoPgon::GetThreadData() and TGeoXtru::GetThreadData() are inline, so consumer translation units directly reference fgInstanceCount. On Windows, automatically exporting DLL symbols does not provide the dllimport semantics required for static data, resulting in unresolved external symbols when linking clients. The counter was only used to pre-size the TLS vector. Resize it to fIndex + 1 instead, which is sufficient to access the object’s non-reused slot and avoids the DLL data reference.
sawenzel
merged commit Sep 3, 2026
8b6be5a
into
trwenz:twenzel/geom-false-sharing-fixes
4 of 27 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull request:
Changes or fixes:
The current Windows CI fails while linking
test_thread_navigationwithunresolved references to
TGeoPgon::fgInstanceCountandTGeoXtru::fgInstanceCount.The corresponding
GetThreadData()functions are inline, causing consumertranslation units to reference these private static data members directly.
On Windows, automatically exporting DLL symbols does not provide the import
semantics required for such data references.
The instance counter is used only to pre-size the TLS vector. Resizing to
fIndex + 1is sufficient to guarantee that the current object's non-reusedslot exists, while avoiding any reference to the counter from the inline
accessor. TLS storage is therefore grown on demand instead of being
preallocated for every existing object.
This should resolve the current Windows CI linker failures.
Validation:
GeomCheckerandthread_navigationbuild successfully.gtest-geom-overlap-navigationpasses.gtest-geom-thread-navigationpasses.gtest-geom-manager-lifetimepasses.Checklist:
This PR fixes #