File tree 1 file changed +11
-4
lines changed
src/BenchmarkDotNet/Disassemblers
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 8
8
using System . Linq ;
9
9
using System . Text . RegularExpressions ;
10
10
using BenchmarkDotNet . Portability ;
11
- using BenchmarkDotNet . Helpers ;
12
11
13
12
namespace BenchmarkDotNet . Disassemblers
14
13
{
@@ -31,9 +30,17 @@ private static ulong GetMinValidAddress()
31
30
} ;
32
31
if ( RuntimeInformation . IsLinux ( ) )
33
32
{
34
- string ? minAddrResult = ProcessHelper . RunAndReadOutput ( "/bin/bash" , "sudo cat /proc/sys/vm/mmap_min_addr" ) ;
35
- ulong . TryParse ( minAddrResult , out ulong minAddress ) ;
36
- return minAddress ;
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 ;
37
44
}
38
45
throw new NotSupportedException ( $ "{ System . Runtime . InteropServices . RuntimeInformation . OSDescription } is not supported") ;
39
46
}
You can’t perform that action at this time.
0 commit comments