forked from mono/mono
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (dotnet/coreclr#23352)
* Move Buffer constants to platform specific files * Add explicit access modifier Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
- Loading branch information
1 parent
d465a7a
commit 1a4014d
Showing
4 changed files
with
55 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
26 changes: 26 additions & 0 deletions
26
netcore/System.Private.CoreLib/shared/System/Buffer.Unix.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,26 @@ | ||
// 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. | ||
|
||
#if BIT64 | ||
using nuint = System.UInt64; | ||
#else | ||
using nuint = System.UInt32; | ||
#endif | ||
|
||
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 | ||
private const nuint MemmoveNativeThreshold = ulong.MaxValue; | ||
#elif ARM | ||
private const nuint MemmoveNativeThreshold = 512; | ||
#else | ||
private const nuint MemmoveNativeThreshold = 2048; | ||
#endif | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
netcore/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,23 @@ | ||
// 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. | ||
|
||
#if BIT64 | ||
using nuint = System.UInt64; | ||
#else | ||
using nuint = System.UInt32; | ||
#endif | ||
|
||
namespace System | ||
{ | ||
public static partial class Buffer | ||
{ | ||
#if ARM64 | ||
// Determine optimal value for Windows. | ||
// https://github.com/dotnet/coreclr/issues/13843 | ||
private const nuint MemmoveNativeThreshold = ulong.MaxValue; | ||
#else | ||
private 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