Repository navigation
Remove 'out' in ReadConsole pinvoke - #9066
Dongbo Wang (daxian-dbw) merged 1 commit into
Conversation
|
Look goo to me. No change is needed as per Dan Thompson (@jazzdelightsme) pointed out below. |
|
Dongbo Wang (@daxian-dbw) : No! (and I verified this by looking at type information in a debugger; I am very sure) |
|
Dan Thompson (@jazzdelightsme) Thanks for catching that! Can you please explain a bit more about the difference between |
|
Ha, I might find it -- https://stackoverflow.com/a/6420546/7129704
|
|
Dongbo Wang (@daxian-dbw) I see in https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/interop-pinvokes.md#strings that StringBuilder marshalling always re-allocate/re-copy buffers. Make sense review our code to reduce such allocations? Although at first glance I did not see how we could do it. And the PR fix could be in 6.2. |
|
Thanks Ilya (@iSazonov). By reading that guideline, it seems |
|
Tracking issue #9139
Please review my old PR first - it is related :-) |
|
Ilya (@iSazonov) We are using |
…voke (PowerShell#9066) Don't pass StringBuilder by reference (using out or ref). Otherwise, the CLR will expect the signature of this argument to be wchar_t ** instead of wchar_t *, and it won't be able to pin StringBuilder's internal buffer. Performance will be significantly degraded.
PR Summary
Revert change based on the comment #8847 (comment)
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.[feature]to your commit messages if the change is significant or affects feature tests