This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Buffer constants to platform specific files
- Loading branch information
1 parent
d2178d3
commit fc22699
Showing
4 changed files
with
43 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace System | ||
{ | ||
public static partial class Buffer | ||
{ | ||
#if ARM64 | ||
// Managed code is currently faster than glibc unoptimized memmove | ||
// TODO-ARM64-UNIX-OPT revisit when glibc optimized memmove is in Linux distros | ||
// https://github.com/dotnet/coreclr/issues/13844 | ||
const nuint MemmoveNativeThreshold = ulong.MaxValue; | ||
#elif ARM | ||
const nuint MemmoveNativeThreshold = 512; | ||
#else | ||
const nuint MemmoveNativeThreshold = 2048; | ||
#endif | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/System.Private.CoreLib/shared/System/Buffer.Windows.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace System | ||
{ | ||
public static partial class Buffer | ||
{ | ||
#if ARM64 || ARM | ||
// Determine optimal value for Windows. | ||
// https://github.com/dotnet/coreclr/issues/13843 | ||
const nuint MemmoveNativeThreshold = ulong.MaxValue; | ||
#else | ||
const nuint MemmoveNativeThreshold = 2048; | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters