The discussion of using StringBuilder makes no mention of the excessive allocations as discussed on the native interop best practices page; the guidance there specifically says to "AVOID StringBuilder parameters." Meanwhile, the recommended best practice ("using char[]s from an ArrayPool") is not mentioned on this page.
I imagine this page has simply fallen out of date, but it'd be nice to present a consistent story about best practices and sample code for guidance.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 560441
The discussion of using StringBuilder makes no mention of the excessive allocations as discussed on the native interop best practices page; the guidance there specifically says to "AVOID StringBuilder parameters." Meanwhile, the recommended best practice ("using char[]s from an ArrayPool") is not mentioned on this page.
I imagine this page has simply fallen out of date, but it'd be nice to present a consistent story about best practices and sample code for guidance.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 560441