Finish removing CLR local-string dependencies - #12518
Open
simonrozsival wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CLR runtime Util::create_directory() helper to avoid dynamic local-string allocation by using a fixed-size stack buffer and in-place component termination when creating intermediate directories.
Changes:
- Replaces
dynamic_local_string<Constants::SENSIBLE_PATH_MAX>usage with a fixedcharbuffer sized toConstants::SENSIBLE_PATH_MAX. - Adds an explicit length check and returns
ENAMETOOLONGwhen the input path does not fit. - Temporarily NUL-terminates each path component in-place before calling
mkdir().
Show a summary per file
| File | Description |
|---|---|
| src/native/clr/runtime-base/util.cc | Switch create_directory() to a fixed stack buffer, add bounded-length rejection, and use in-place component termination before mkdir(). |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-create-directory
branch
from
August 25, 2026 15:10
074222a to
7280623
Compare
simonrozsival
changed the base branch from
main
to
dev/simonrozsival/simplify-dso-name
August 25, 2026 15:10
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-create-directory
branch
from
August 25, 2026 15:39
7280623 to
98cc195
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-create-directory
branch
from
August 25, 2026 15:43
98cc195 to
886d2a5
Compare
Replace the resizable local string in Util::create_directory with a checked mutable path buffer and report ENAMETOOLONG when it cannot fit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Stop scanning once the fixed create-directory buffer capacity is reached. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The stacked fixed-buffer migrations remove every remaining CLR and NativeAOT consumer of strings.hh, so drop the final includes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the former dynamic local string behavior with malloc/free instead of imposing SENSIBLE_PATH_MAX as a path limit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the sensible local buffer for common paths and allocate only when the complete path exceeds it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
simonrozsival
force-pushed
the
dev/simonrozsival/simplify-create-directory
branch
from
August 25, 2026 16:03
886d2a5 to
1104485
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
malloc()only for larger valuesmkdir()errnoacross conditional heap cleanupstrings.hhincludes after the lower stack layers migrate their consumersThis is the top PR in stack #12519. Together, the stack removes all CLR/NativeAOT uses of the local-string hierarchy and their
strings.hhdependencies.Validation