Remove pinning from StringBuilder (#64405)
authorStephen Toub <stoub@microsoft.com>
Fri, 28 Jan 2022 20:04:30 +0000 (15:04 -0500)
committerGitHub <noreply@github.com>
Fri, 28 Jan 2022 20:04:30 +0000 (15:04 -0500)
commit315fb41e7d75f3103a50aa394e2698baf5e56252
treef508dd6ecbcf27889872f2d2970648aef287dfa4
parentd06d9c92ca6601eb4170015d3fb2182ecac54388
Remove pinning from StringBuilder (#64405)

Switch from pointers to refs to avoid pinning the inputs.

As part of this, I also consolidated the fast-path that was there specifically for string inputs to also apply to span inputs, char arrays, pointers, etc.
src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs