-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[cdac] Tighten cdac_data friend declarations #108525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cdac] Tighten cdac_data friend declarations #108525
Conversation
|
Tagging subscribers to this area: @tommcdon |
|
@dotnet-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more round of bikeshedding this comment ;-)
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: Elinor Fung <[email protected]>
tighten cdac_data friend declarations Previously classes exposed internals to all cdac_data specializations. By changing the friend declarations to the exact specialization which needs will access the internals, we can better verify where the internals are accessed and ensure cdac_data<T> accesses the correct class.
Tightens
cdac_datafriend relationships to only expose internals to exact specialization.Previously classes exposed internals to all
cdac_dataspecializations. By changing the friend declarations to the exact specialization which needs will access the internals, we can better verify where the internals are accessed and ensurecdac_data<T>accesses the correct class.Note there are two special cases.
Some classes
Aare purposefully used as part of a differentcdac_data<B>which may hold an instance of them. For examplecdac_data<Thread>readsThreadExceptionStateoffsets. In this case classA(ThreadExceptionState) declares friend tocdac_data<B>(cdac_data<Thread>).Given
SListis a generic implementation of a singly linked list, it seems to make sense for allcdac_dataspecializations to be able to access it, therefore the declaration was not changed.