Optimize GC.AllocateUninitializedArray and use it in StringBuilder (#27364)
Optimize GC.AllocateUninitializedArray and use it in StringBuilder (#27364)

* use GC.AllocateUninitializedArray for allocating internal char buffers

* force inlining of AllocateUninitializedArray to have no perf hit on the small buffers hot path

* insrease the threshold from 256 to 2048 bytes

* use Unsafe.As instead of a cast

* remove the size precondition from AllocateNewArray method, the called AllocateSzArray is responsible for handling negative size

Signed-off-by: dotnet-bot <03c4cb6107ae99956a7681f2c97ff7104809a2bd@microsoft.com>

shimingsg/corefx,ericstj/corefx,ericstj/corefx,ericstj/corefx,shimingsg/corefx,shimingsg/corefx,shimingsg/corefx,shimingsg/corefx,ericstj/corefx,shimingsg/corefx,shimingsg/corefx,ericstj/corefx,ericstj/corefx,ericstj/corefx