Buffer.Unix.cs 912 B

123456789101112131415161718192021222324252627
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. #pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
  5. #if BIT64
  6. using nuint = System.UInt64;
  7. #else
  8. using nuint = System.UInt32;
  9. #endif
  10. namespace System
  11. {
  12. public static partial class Buffer
  13. {
  14. #if ARM64
  15. // Managed code is currently faster than glibc unoptimized memmove
  16. // TODO-ARM64-UNIX-OPT revisit when glibc optimized memmove is in Linux distros
  17. // https://github.com/dotnet/coreclr/issues/13844
  18. private const nuint MemmoveNativeThreshold = ulong.MaxValue;
  19. #elif ARM
  20. private const nuint MemmoveNativeThreshold = 512;
  21. #else
  22. private const nuint MemmoveNativeThreshold = 2048;
  23. #endif
  24. }
  25. }