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
- ValueTypeFixupInfo.cs
- MetadataSerializer.cs
- Int32Rect.cs
- mediaclock.cs
- StringToken.cs
- BindingExpressionUncommonField.cs
- InvalidProgramException.cs
- ClientScriptManager.cs
- TokenFactoryCredential.cs
- References.cs
- ScriptingProfileServiceSection.cs
- TreeViewHitTestInfo.cs
- ObjectSet.cs
- EntitySqlQueryState.cs
- DodSequenceMerge.cs
- ColorDialog.cs
- ListCollectionView.cs
- BitStack.cs
- BindValidator.cs
- LightweightEntityWrapper.cs
- Persist.cs
- BaseTreeIterator.cs
- ApplicationContext.cs
- OleServicesContext.cs
- APCustomTypeDescriptor.cs
- VariableBinder.cs
- CmsInterop.cs
- URIFormatException.cs
- CorruptingExceptionCommon.cs
- CommunicationObjectManager.cs
- Scalars.cs
- PersistChildrenAttribute.cs
- SeekStoryboard.cs
- GroupItemAutomationPeer.cs
- WebProxyScriptElement.cs
- Function.cs
- SafeEventLogReadHandle.cs
- Drawing.cs
- Delegate.cs
- DataTableCollection.cs
- PropertyGridDesigner.cs
- DataGridBeginningEditEventArgs.cs
- Msec.cs
- XmlAttributeCollection.cs
- ToolStripRendererSwitcher.cs
- IssuedTokenParametersEndpointAddressElement.cs
- fixedPageContentExtractor.cs
- Canonicalizers.cs
- CheckBoxBaseAdapter.cs
- SymbolEqualComparer.cs
- Assembly.cs
- SerializationFieldInfo.cs
- RepeaterCommandEventArgs.cs
- TextEmbeddedObject.cs
- DSGeneratorProblem.cs
- GetReadStreamResult.cs
- MenuItemBinding.cs
- ClientUtils.cs
- DataShape.cs
- COM2ExtendedBrowsingHandler.cs
- ZoneButton.cs
- ForeignKeyConstraint.cs
- Path.cs
- MailMessageEventArgs.cs
- filewebresponse.cs
- GlyphInfoList.cs
- RegistryKey.cs
- MouseCaptureWithinProperty.cs
- UserControl.cs
- UnionCqlBlock.cs
- UrlAuthFailedErrorFormatter.cs
- SocketInformation.cs
- PersonalizationDictionary.cs
- MemberDomainMap.cs
- PowerStatus.cs
- DataContractSerializerOperationGenerator.cs
- BitmapEffectRenderDataResource.cs
- ByteKeyFrameCollection.cs
- DefaultWorkflowLoaderService.cs
- ParseHttpDate.cs
- IgnoreSection.cs
- GridViewUpdateEventArgs.cs
- CodeTypeDeclarationCollection.cs
- _SslSessionsCache.cs
- RegisteredExpandoAttribute.cs
- EventToken.cs
- SymbolEqualComparer.cs
- PaginationProgressEventArgs.cs
- FirstMatchCodeGroup.cs
- NavigationProgressEventArgs.cs
- NetworkInformationException.cs
- MobileErrorInfo.cs
- ButtonBase.cs
- DeclarationUpdate.cs
- X509ChainElement.cs
- mediapermission.cs
- DataGridViewBand.cs
- SymDocumentType.cs
- X509ScopedServiceCertificateElementCollection.cs
- ColorEditor.cs