diff options
Diffstat (limited to 'src/mscorlib/src/System/Runtime/GcSettings.cs')
-rw-r--r-- | src/mscorlib/src/System/Runtime/GcSettings.cs | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/mscorlib/src/System/Runtime/GcSettings.cs b/src/mscorlib/src/System/Runtime/GcSettings.cs index 11143c5ee2..993a24f986 100644 --- a/src/mscorlib/src/System/Runtime/GcSettings.cs +++ b/src/mscorlib/src/System/Runtime/GcSettings.cs @@ -3,12 +3,13 @@ // See the LICENSE file in the project root for more information. -namespace System.Runtime { - using System; - using System.Runtime.CompilerServices; - using System.Runtime.ConstrainedExecution; - using System.Diagnostics.Contracts; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.ConstrainedExecution; +using System.Diagnostics.Contracts; +namespace System.Runtime +{ // These settings are the same format as in clr\src\vm\gcpriv.h // make sure you change that file if you change this file! @@ -22,34 +23,34 @@ namespace System.Runtime { [Serializable] public enum GCLatencyMode { - Batch = 0, + Batch = 0, Interactive = 1, LowLatency = 2, SustainedLowLatency = 3, NoGCRegion = 4 } - public static class GCSettings + public static class GCSettings { - enum SetLatencyModeStatus + private enum SetLatencyModeStatus { Succeeded = 0, NoGCInProgress = 1 // NoGCRegion is in progress, can't change pause mode. }; - + public static GCLatencyMode LatencyMode { - get + get { return (GCLatencyMode)(GC.GetGCLatencyMode()); } // We don't want to allow this API when hosted. - set + set { if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.SustainedLowLatency)) { - throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum")); + throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_Enum); } Contract.EndContractBlock(); @@ -60,18 +61,18 @@ namespace System.Runtime { public static GCLargeObjectHeapCompactionMode LargeObjectHeapCompactionMode { - get + get { return (GCLargeObjectHeapCompactionMode)(GC.GetLOHCompactionMode()); } // We don't want to allow this API when hosted. - set + set { - if ((value < GCLargeObjectHeapCompactionMode.Default) || + if ((value < GCLargeObjectHeapCompactionMode.Default) || (value > GCLargeObjectHeapCompactionMode.CompactOnce)) { - throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum")); + throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_Enum); } Contract.EndContractBlock(); @@ -79,11 +80,12 @@ namespace System.Runtime { } } - public static bool IsServerGC + public static bool IsServerGC { - get { + get + { return GC.IsServerGC(); } - } + } } } |