-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Remove strtok, strtok_s, wcstok_s PAL APIs #98008
Conversation
This reverts commit 9cf7d84.
…nstead of wcstok_s.
…to avoid heap allocations
src/coreclr/vm/profilinghelper.cpp
Outdated
|
||
PathString path{profilerList, sectionStart, pathEnd}; | ||
StackSString clsidString{profilerList, clsidStart, sectionEnd}; | ||
NewArrayHolder<WCHAR> clsidStringRaw = clsidString.GetCopyOfUnicodeString(); |
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.
NewArrayHolder<WCHAR> clsidStringRaw = clsidString.GetCopyOfUnicodeString(); |
src/coreclr/vm/profilinghelper.cpp
Outdated
CLSID clsid; | ||
hr = ProfilingAPIUtility::ProfilerCLSIDFromString(currentGuid, &clsid); | ||
hr = ProfilingAPIUtility::ProfilerCLSIDFromString(clsidStringRaw, &clsid); |
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.
hr = ProfilingAPIUtility::ProfilerCLSIDFromString(clsidStringRaw, &clsid); | |
hr = ProfilingAPIUtility::ProfilerCLSIDFromString(clsidString.GetUnicode(), &clsid); |
?
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.
Thanks
@dotnet-policy-service rerun |
These APIs were used extremely rarely throughout CoreCLR (one usage each), so replace the usages with platform-native APIs (strtok_r for strtok and strtok_s) or use SString to hand-roll the one usage (for wcstok_s).