@@ -17,7 +17,7 @@ public static bool Open()
1717 // While this is supported in modern CPUs, the technique used for allocating executable memory, copying OP Code
1818 // for the read of the time stamp and invoking the OP Code can be detected as Malware by some anti-virus vendors.
1919 // https://github.com/zeromq/netmq/issues/1071
20- string val = Environment . GetEnvironmentVariable ( "NETQM_SUPPRESS_RDTSC" ) ;
20+ string ? val = Environment . GetEnvironmentVariable ( "NETQM_SUPPRESS_RDTSC" ) ;
2121 if ( ! string . IsNullOrEmpty ( val ) )
2222 return false ;
2323#if NETSTANDARD || NET
@@ -83,8 +83,8 @@ private static bool IsARMArchitecture()
8383 {
8484 // force to load from mono gac
8585 Assembly currentAssembly = Assembly . Load ( "Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" ) ;
86- Type syscall = currentAssembly . GetType ( "Mono.Unix.Native.Syscall" ) ;
87- Type utsname = currentAssembly . GetType ( "Mono.Unix.Native.Utsname" ) ;
86+ Type ? syscall = currentAssembly . GetType ( "Mono.Unix.Native.Syscall" ) ;
87+ Type ? utsname = currentAssembly . GetType ( "Mono.Unix.Native.Utsname" ) ;
8888 if ( syscall is null || utsname is null ) return false ;
8989 MethodInfo ? uname = syscall . GetMethod ( "uname" ) ;
9090 object ? [ ] parameters = { null } ;
@@ -111,9 +111,9 @@ public static void Close()
111111 Assembly . Load ( "Mono.Posix, Version=2.0.0.0, Culture=neutral, " +
112112 "PublicKeyToken=0738eb9f132ed756" ) ;
113113
114- Type syscall = assembly . GetType ( "Mono.Unix.Native.Syscall" ) ;
115- MethodInfo munmap = syscall . GetMethod ( "munmap" ) ;
116- munmap . Invoke ( null , new object [ ] { s_codeBuffer , s_size } ) ;
114+ Type ? syscall = assembly . GetType ( "Mono.Unix.Native.Syscall" ) ;
115+ MethodInfo ? munmap = syscall ? . GetMethod ( "munmap" ) ;
116+ munmap ? . Invoke ( null , new object [ ] { s_codeBuffer , s_size } ) ;
117117 }
118118 else
119119 {
0 commit comments