Conversation
…pendency Co-authored-by: jkotas <[email protected]>
…m and add min/max to stdafx.h Co-authored-by: jkotas <[email protected]>
Copilot
AI
changed the title
[WIP] Clean up src/coreclr/src/inc by removing private details
Move stgpool to md subsystem and eliminate CDescPool dependency on StgPool
Dec 24, 2025
jkotas
reviewed
Dec 24, 2025
…e throwing new in CDescPool Co-authored-by: jkotas <[email protected]>
jkotas
reviewed
Dec 24, 2025
jkotas
reviewed
Dec 24, 2025
Co-authored-by: jkotas <[email protected]>
Copilot
AI
changed the title
Move stgpool to md subsystem and eliminate CDescPool dependency on StgPool
Move stgpool to md subsystem, extract memory streams, and eliminate CDescPool dependency on StgPool
Dec 24, 2025
Co-authored-by: jkotas <[email protected]>
jkotas
reviewed
Dec 24, 2025
Member
|
@copilot I see a lot of build breaks in the new memorystreams.h/.cpp: Please address them and make sure that the build succeeds. |
jkotas
reviewed
Dec 27, 2025
… to 3) Co-authored-by: jkotas <[email protected]>
jkotas
reviewed
Dec 27, 2025
jkotas
reviewed
Dec 27, 2025
Co-authored-by: jkotas <[email protected]>
Contributor
There was a problem hiding this comment.
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]>
jkoritzinsky
approved these changes
Dec 29, 2025
This was referenced Jan 9, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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.*