diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2017-04-13 14:17:19 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2017-04-13 14:17:19 +0900 |
commit | a56e30c8d33048216567753d9d3fefc2152af8ac (patch) | |
tree | 7e5d979695fc4a431740982eb1cfecc2898b23a5 /src/mscorlib/src/System/Runtime/GcSettings.cs | |
parent | 4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff) | |
download | coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2 coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip |
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
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(); } - } + } } } |