-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Move stgpool to md subsystem, extract memory streams, eliminate VM dependencies on MD internals #122723
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
Conversation
…pendency Co-authored-by: jkotas <[email protected]>
…m and add min/max to stdafx.h Co-authored-by: jkotas <[email protected]>
jkotas
left a comment
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.
@copilot address feedback
…e throwing new in CDescPool Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
jkotas
left a comment
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.
@copilot address feedback
|
@copilot I see a lot of build breaks in the new memorystreams.h/.cpp: Please address them and make sure that the build succeeds. |
… to 3) Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
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.
Pull request overview
This PR successfully refactors the metadata (MD) subsystem to eliminate VM dependencies on MD internal implementation details by relocating stgpool files, extracting memory stream classes, and reimplementing CDescPool.
Key changes:
- Moved stgpool files from shared inc/utilcode to MD-specific directories (md/inc and md/runtime)
- Extracted CInMemoryStream and CGrowableStream to new memorystreams.h/cpp files in inc/utilcode
- Refactored CDescPool from StgPool inheritance to standalone allocator with flexible array members
- Moved CPackedLen struct from stgpooli.h to mdfileformat.h for broader reusability
Reviewed changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/commtmemberinfomap.h | Reimplemented CDescPool as standalone allocator with segmented memory management |
| src/coreclr/vm/commtmemberinfomap.cpp | Updated CDescPool call sites to use size_t types and removed unnecessary null checks |
| src/coreclr/vm/common.h | Changed include from stgpool.h to memorystreams.h |
| src/coreclr/vm/mlinfo.cpp | Added mdfileformat.h include for CPackedLen |
| src/coreclr/utilcode/memorystreams.cpp | New file containing CInMemoryStream and CGrowableStream implementations |
| src/coreclr/utilcode/CMakeLists.txt | Removed stgpool files, added memorystreams.cpp |
| src/coreclr/md/runtime/stgpool.cpp | Removed memory stream classes (moved to memorystreams.cpp) |
| src/coreclr/md/runtime/stgpooli.cpp | New location for stgpooli implementation |
| src/coreclr/md/runtime/stgpoolreadonly.cpp | New location for read-only pool implementation |
| src/coreclr/md/runtime/stdafx.h | Added using declarations for std::min/max |
| src/coreclr/md/runtime/CMakeLists.txt | Added stgpool files to MD runtime build |
| src/coreclr/md/inc/stgpool.h | New location, removed memory stream class definitions |
| src/coreclr/md/inc/stgpooli.h | New location with forward declaration for CPackedLen |
| src/coreclr/md/inc/streamutil.h | Removed unused NullStream class |
| src/coreclr/md/compiler/regmeta_emit.cpp | Added memorystreams.h include |
| src/coreclr/md/ceefilegen/cceegen.cpp | Changed include from stgpool.h to memorystreams.h |
| src/coreclr/inc/stgpooli.h | Deleted (moved to md/inc) |
| src/coreclr/inc/memorystreams.h | New file with CInMemoryStream and CGrowableStream declarations |
| src/coreclr/inc/memoryrange.h | Added contract.h include, removed blank lines |
| src/coreclr/inc/mdfileformat.h | Added CPackedLen struct definition |
| src/coreclr/inc/formattype.cpp | Removed Debug_ReportError call |
| src/coreclr/inc/caparser.h | Changed include from stgpooli.h to mdfileformat.h |
| src/coreclr/ilasm/ilasmpch.h | Removed stgpooli.h include (now in mdfileformat.h) |
| src/coreclr/debug/di/module.cpp | Changed include from stgpool.h to memorystreams.h |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Fixes #35624
stgpool.h,stgpooli.hfromsrc/coreclr/inc/tosrc/coreclr/md/inc/stgpool.cpp,stgpooli.cpp,stgpoolreadonly.cppfromsrc/coreclr/utilcode/tosrc/coreclr/md/runtime/CPackedLenstruct fromstgpooli.htosrc/coreclr/inc/mdfileformat.hCInMemoryStreamandCGrowableStreamfromstgpool.*tomemorystreams.*