Fix ServiceController name population perf (dotnet/corefx#32072)

* Fix ServiceController name population perf

* Split tests

* Remove dead field

* Remove new use of DangerousGetHandle

* SafeHandle all the things!

* VSB #1

* VSB #2

* Fix GLE

* Initialize machineName in ctor

* Test for empty name ex

* Null names

* Inadvertent edit

* Unix build

* Move interop into class

* Reverse SafeHandle for HAllocGlobal

* Fix tests

* Disable test for NETFX

* CR feedback

* Pattern matching on VSB

* Direct call

* typo

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
This commit is contained in:
Dan Moseley 2018-09-04 15:21:28 -07:00 коммит произвёл Jan Kotas
Родитель c8a9707235
Коммит c4f82672cb
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -48,11 +48,22 @@ namespace System.Text
Grow(capacity - _chars.Length);
}
/// <summary>
/// Get a pinnable reference to the builder.
/// Does not ensure there is a null char after <see cref="Length"/>
/// This overload is pattern matched in the C# 7.3+ compiler so you can omit
/// the explicit method call, and write eg "fixed (char* c = builder)"
/// </summary>
public ref char GetPinnableReference()
{
return ref MemoryMarshal.GetReference(_chars);
}
/// <summary>
/// Get a pinnable reference to the builder.
/// </summary>
/// <param name="terminate">Ensures that the builder has a null char after <see cref="Length"/></param>
public ref char GetPinnableReference(bool terminate = false)
public ref char GetPinnableReference(bool terminate)
{
if (terminate)
{