Skip to content

Conversation

@rcj1
Copy link
Contributor

@rcj1 rcj1 commented Aug 5, 2025

No description provided.

Copilot AI review requested due to automatic review settings August 5, 2025 21:32
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements the GetThreadStaticBaseAddress cDAC (Contract-based Data Access) API to enable access to thread-local static fields in the .NET runtime. The implementation provides a new diagnostic interface for retrieving base addresses of both GC and non-GC thread static variables.

Key changes:

  • Implements GetThreadStaticBaseAddress method in SOSDacImpl to replace legacy fallback with full cDAC implementation
  • Adds comprehensive thread-local storage (TLS) data structures and contracts for accessing thread static fields
  • Integrates new TLS functionality into RuntimeTypeSystem contract for retrieving thread static base pointers

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
SOSDacImpl.cs Replaces legacy implementation with full cDAC implementation of GetThreadStaticBaseAddress
ThreadStaticsInfo.cs New data structure for thread static information containing GC and non-GC TLS indices
ThreadLocalData.cs New data structure representing thread-local data with collectible/non-collectible arrays
Thread.cs Adds ThreadLocalDataPtr field to Thread data structure
TLSIndex.cs New data structure for TLS index with allocation status and type information
InflightTLSData.cs New data structure for in-flight TLS data during class constructor execution
Thread_1.cs Implements GetThreadLocalStaticBase method with TLS index type handling
RuntimeTypeSystem_1.cs Adds methods to get GC/non-GC thread static base pointers
Constants.cs Adds new global constants for TLS array operations
DataType.cs Adds new data types for thread-local storage structures
IThread.cs Adds GetThreadLocalStaticBase method to thread contract interface
IRuntimeTypeSystem.cs Adds GC/non-GC thread static base pointer methods to contract
threadstatics.h Moves InFlightTLSData structure definition to header for DAC access
threadstatics.cpp Updates InFlightTLSData implementation to use header definition
threads.h Adds ThreadLocalDataPtr to thread data structure for cDAC
datadescriptor.inc Adds cDAC type descriptors for all new TLS-related structures
Thread.md Documents new thread contract API and data structures
RuntimeTypeSystem.md Documents new runtime type system methods for thread statics

@rcj1 rcj1 requested a review from max-charlamb August 5, 2025 21:41
Copy link
Member

@max-charlamb max-charlamb left a comment

Choose a reason for hiding this comment

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

looks good except for a couple small comments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants