// See the LICENSE file in the project root for more information.
using System;
+using System.Runtime.InteropServices;
//Measure allocation time when allocating objects on a single thread.
//Should be run with server GC
return;
}
- string processor = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
- Console.WriteLine("Running on {0}", processor);
+ Console.WriteLine("Running on {0}", RuntimeInformation.ProcessArchitecture);
UInt64 MaxBytes = 1500000000;
- if (processor.ToLower() == "amd64")
+ if (RuntimeInformation.ProcessArchitecture == Architecture.X64)
{
MaxBytes = 5000000000;
}
//Testing the special values
using System;
+using System.Runtime.InteropServices;
internal class pow1
{
bool pass = true;
//Check if the test is being executed on ARMARCH
- bool isProcessorArmArch = false;
-
- string processorArchEnvVar = null;
-
- processorArchEnvVar = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
-
- if ((processorArchEnvVar != null)
- && (processorArchEnvVar.Equals("ARM", StringComparison.CurrentCultureIgnoreCase)
- || processorArchEnvVar.Equals("ARM64", StringComparison.CurrentCultureIgnoreCase)))
- {
- isProcessorArmArch = true;
- }
+ bool isProcessorArmArch = RuntimeInformation.ProcessArchitecture == Architecture.Arm
+ || RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
x = 0;
y = 0;
// Variation on array length
+using System.Runtime.InteropServices;
using System;
internal class DblArray1
{
public static int Main()
{
- if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86")
+ if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
{
s_LOH_GEN = 2;
}
// 6) the threshold can be set by registry key DoubleArrayToLargeObjectHeap
+using System.Runtime.InteropServices;
using System;
internal class DblArray
{
public static int Main()
{
- if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86")
+ if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
{
s_LOH_GEN = 2;
}
using System;
+using System.Runtime.InteropServices;
internal struct VT
{
public static int Main()
{
- Console.WriteLine(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"));
- if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86")
+ Console.WriteLine(RuntimeInformation.ProcessArchitecture);
+ if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
{
s_LOH_GEN = 2;
}
// Test DoubleArrayToLargeObjectHeap - need to set the key to <= 100
using System;
+using System.Runtime.InteropServices;
internal class DblArray4
{
private static int s_LOH_GEN = 0;
public static int Main()
{
- if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86")
+ if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
{
s_LOH_GEN = 2;
}