File tree 1 file changed +2
-14
lines changed
src/BenchmarkDotNet/Disassemblers 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -21,27 +21,15 @@ private static ulong GetMinValidAddress()
21
21
// https://github.com/dotnet/BenchmarkDotNet/pull/2413#issuecomment-1688100117
22
22
if ( RuntimeInformation . IsWindows ( ) )
23
23
return 65536 ;
24
+ if ( RuntimeInformation . IsLinux ( ) )
25
+ return ( ulong ) Environment . SystemPageSize ;
24
26
if ( RuntimeInformation . IsMacOS ( ) )
25
27
return RuntimeInformation . GetCurrentPlatform ( ) switch
26
28
{
27
29
Environments . Platform . X86 or Environments . Platform . X64 => 4096 ,
28
30
Environments . Platform . Arm64 => 0x100000000 ,
29
31
_ => throw new NotSupportedException ( $ "{ RuntimeInformation . GetCurrentPlatform ( ) } is not supported")
30
32
} ;
31
- if ( RuntimeInformation . IsLinux ( ) )
32
- {
33
- try
34
- {
35
- if ( File . Exists ( "/proc/sys/vm/mmap_min_addr" ) )
36
- {
37
- string ? minAddrResult = File . ReadAllText ( "/proc/sys/vm/mmap_min_addr" ) ;
38
- ulong . TryParse ( minAddrResult , out ulong minAddress ) ;
39
- return minAddress ;
40
- }
41
- }
42
- catch { }
43
- return 0 ;
44
- }
45
33
throw new NotSupportedException ( $ "{ System . Runtime . InteropServices . RuntimeInformation . OSDescription } is not supported") ;
46
34
}
47
35
You can’t perform that action at this time.
0 commit comments