-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Remove some StringBuilderCache usage from Corelib #64522
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
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
src/libraries/System.Private.CoreLib/src/System/Globalization/TimeSpanParse.cs
Show resolved
Hide resolved
|
Tagging subscribers to this area: @dotnet/area-meta Issue Detailsnull
|
| case '\"': | ||
| StringBuilder enquotedString = StringBuilderCache.Acquire(); | ||
| if (!DateTimeParse.TryParseQuoteString(format, i, enquotedString, out tokenLen)) | ||
| var enquotedString = new ValueStringBuilder(32); |
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.
would it make sense to be slightly less conservative? 64?
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.
sure
src/libraries/System.Private.CoreLib/src/System/Globalization/TimeSpanParse.cs
Show resolved
Hide resolved
|
BTW, I noticed the comment higher up StreamWriter about #8890 The docs I've seen say that it's not guaranteed that stackallocs are zero inited - although the issue above implies we always do. Should we document that we do without SkipLocalsInit, and don't with SkipLocalsInit? Otherwise it's hard to reason about code. |
I don't believe SkipLocalsInit is relevant to that comment. It's talking about ref temporaries on the stack, which need to be zeroed even with SkipLocalsInit. |
No description provided.