Repository navigation
Refactor DbgTransportTarget usage to eliminate dynamic allocation. - #122011
Conversation
Remove unused interface and header.
|
/cc @dotnet/dotnet-diag-contrib |
|
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR refactors the DbgTransportTarget usage in the CoreCLR debugger infrastructure to eliminate dynamic memory allocation. The global instance is changed from a pointer (g_pDbgTransportTarget) to a value (g_DbgTransportTarget), simplifying the code by removing heap allocation, null checks, and manual cleanup. Additionally, the unused header file coreclrremotedebugginginterfaces.h and its forward declaration of ICoreClrDebugTarget are removed.
Key Changes
- Converted global
DbgTransportTargetfrom pointer-based to value-based storage - Updated all usage sites to take the address of the global instance
- Removed unused interface declaration and header file
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/coreclr/debug/inc/coreclrremotedebugginginterfaces.h |
Deleted unused header containing forward declaration of ICoreClrDebugTarget |
src/coreclr/debug/di/dbgtransportmanager.h |
Changed extern declaration from pointer to value and removed include of deleted header |
src/coreclr/debug/di/dbgtransportmanager.cpp |
Changed global definition from pointer to value with aggregate initialization and removed include of deleted header |
src/coreclr/debug/di/cordb.cpp |
Simplified DLL initialization/cleanup by removing heap allocation, null checks, and manual delete |
src/coreclr/debug/di/shimremotedatatarget.cpp |
Updated to take address of global value instead of using pointer directly |
src/coreclr/debug/di/remoteeventchannel.cpp |
Updated to take address of global value instead of using pointer directly |
src/coreclr/debug/di/dbgtransportpipeline.cpp |
Updated two locations to take address of global value instead of using pointer directly |
|
Thanks @AaronRobinsonMSFT! |
Remove unused interface and header.