Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / GcSettings.cs / 1305376 / GcSettings.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Runtime {
using System;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Security.Permissions;
using System.Diagnostics.Contracts;
// This is the same format as in clr\src\vm\gcpriv.h
// make sure you change that one if you change this one!
[Serializable]
public enum GCLatencyMode
{
Batch = 0,
Interactive = 1,
LowLatency = 2
}
public static class GCSettings
{
public static GCLatencyMode LatencyMode
{
[System.Security.SecuritySafeCritical] // auto-generated
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return (GCLatencyMode)(GC.GetGCLatencyMode());
}
// We don't want to allow this API when hosted.
[System.Security.SecurityCritical] // auto-generated_required
[HostProtection(MayLeakOnAbort = true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
set
{
if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.LowLatency))
{
throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
}
Contract.EndContractBlock();
GC.SetGCLatencyMode((int)value);
}
}
public static bool IsServerGC
{
[System.Security.SecuritySafeCritical] // auto-generated
get {
return GC.IsServerGC();
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Runtime {
using System;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Security.Permissions;
using System.Diagnostics.Contracts;
// This is the same format as in clr\src\vm\gcpriv.h
// make sure you change that one if you change this one!
[Serializable]
public enum GCLatencyMode
{
Batch = 0,
Interactive = 1,
LowLatency = 2
}
public static class GCSettings
{
public static GCLatencyMode LatencyMode
{
[System.Security.SecuritySafeCritical] // auto-generated
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return (GCLatencyMode)(GC.GetGCLatencyMode());
}
// We don't want to allow this API when hosted.
[System.Security.SecurityCritical] // auto-generated_required
[HostProtection(MayLeakOnAbort = true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
set
{
if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.LowLatency))
{
throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
}
Contract.EndContractBlock();
GC.SetGCLatencyMode((int)value);
}
}
public static bool IsServerGC
{
[System.Security.SecuritySafeCritical] // auto-generated
get {
return GC.IsServerGC();
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PrinterResolution.cs
- WebPartPersonalization.cs
- RawTextInputReport.cs
- WebAdminConfigurationHelper.cs
- DBPropSet.cs
- WorkflowRuntimeServiceElement.cs
- XPathNavigatorKeyComparer.cs
- TemplateModeChangedEventArgs.cs
- RNGCryptoServiceProvider.cs
- DetailsViewDeleteEventArgs.cs
- NamedObject.cs
- SelectionHighlightInfo.cs
- HttpListener.cs
- WindowCollection.cs
- MediaContextNotificationWindow.cs
- ObjectListItemCollection.cs
- CodeDirectionExpression.cs
- OperationFormatter.cs
- CompositeDispatchFormatter.cs
- ExpressionLink.cs
- WhiteSpaceTrimStringConverter.cs
- Array.cs
- TextSerializer.cs
- RadialGradientBrush.cs
- InternalBase.cs
- COM2FontConverter.cs
- DownloadProgressEventArgs.cs
- Region.cs
- NameTable.cs
- CopyNamespacesAction.cs
- EventProxy.cs
- TypeDescriptionProviderAttribute.cs
- WebPartZoneBase.cs
- GradientBrush.cs
- CodeTypeReferenceExpression.cs
- AuthenticationService.cs
- UnsettableComboBox.cs
- ChannelSinkStacks.cs
- MetadataItem.cs
- TextEditorSpelling.cs
- XmlSchemaValidator.cs
- ToolStripItem.cs
- Renderer.cs
- PageContentCollection.cs
- ConstraintCollection.cs
- OracleRowUpdatingEventArgs.cs
- HideDisabledControlAdapter.cs
- WhitespaceSignificantCollectionAttribute.cs
- TableCellCollection.cs
- ItemsControlAutomationPeer.cs
- TypeTypeConverter.cs
- ToolStripSeparator.cs
- SafeRightsManagementPubHandle.cs
- ApplyImportsAction.cs
- FilterElement.cs
- CompilationUnit.cs
- AdapterDictionary.cs
- EntityViewGenerationAttribute.cs
- FusionWrap.cs
- ContainsRowNumberChecker.cs
- DataRecord.cs
- Int64Storage.cs
- PenLineJoinValidation.cs
- _ServiceNameStore.cs
- SmiRecordBuffer.cs
- HttpInputStream.cs
- TextTreeNode.cs
- SHA384Managed.cs
- UITypeEditor.cs
- SimplePropertyEntry.cs
- ShellProvider.cs
- X509Logo.cs
- IsolatedStorageFileStream.cs
- mongolianshape.cs
- ExtendedPropertyCollection.cs
- XmlSerializerAssemblyAttribute.cs
- CodeCommentStatementCollection.cs
- StringDictionaryCodeDomSerializer.cs
- Win32Exception.cs
- XAMLParseException.cs
- PassportPrincipal.cs
- UIElement3D.cs
- ImageCodecInfoPrivate.cs
- InkCanvasSelection.cs
- SqlFacetAttribute.cs
- SafeLocalAllocation.cs
- GatewayDefinition.cs
- Wrapper.cs
- DataTableReaderListener.cs
- WizardPanel.cs
- OlePropertyStructs.cs
- TreeView.cs
- ShapingWorkspace.cs
- StylusPlugin.cs
- PageContent.cs
- MimeMapping.cs
- ItemContainerGenerator.cs
- AnimationClockResource.cs
- CursorEditor.cs
- OciHandle.cs