[2020-02] Avoid following invalid pointers in mono_w32process_get_modules on Darwin...
[mono-project.git] / mono / tests / allow-synchronous-major.cs
blob914b6ccad1b348dd284401ebf5c8d15424ef05ef
1 using System;
2 using System.Reflection;
4 public class Test
6 public static int Main ()
8 var t = Type.GetType("Mono.Runtime");
9 if (t == null)
10 return 1;
11 var setGCAllowSynchronousMajor = (Func<bool,bool>) Delegate.CreateDelegate(typeof(Func<bool,bool>),
13 "SetGCAllowSynchronousMajor",
14 ignoreCase:false,
15 throwOnBindFailure:false);
16 if (setGCAllowSynchronousMajor == null)
17 return 1;
19 if (!setGCAllowSynchronousMajor (false))
20 Console.WriteLine ("could not disable synchronous major");
21 if (!setGCAllowSynchronousMajor (true))
22 return 1;
24 return 0;