Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Runtime / GcSettings.cs / 1 / GcSettings.cs
namespace System.Runtime {
using System;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Security.Permissions;
// 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
{
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return (GCLatencyMode)(GC.nativeGetGCLatencyMode());
}
// We don't want to allow this API when hosted.
[HostProtection(MayLeakOnAbort = true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[PermissionSetAttribute(SecurityAction.LinkDemand, Name="FullTrust")]
set
{
if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.LowLatency))
{
throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
}
GC.nativeSetGCLatencyMode((int)value);
}
}
public static bool IsServerGC
{
get {
return GC.nativeIsServerGC();
}
}
}
}
// 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;
// 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
{
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return (GCLatencyMode)(GC.nativeGetGCLatencyMode());
}
// We don't want to allow this API when hosted.
[HostProtection(MayLeakOnAbort = true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[PermissionSetAttribute(SecurityAction.LinkDemand, Name="FullTrust")]
set
{
if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.LowLatency))
{
throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
}
GC.nativeSetGCLatencyMode((int)value);
}
}
public static bool IsServerGC
{
get {
return GC.nativeIsServerGC();
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DoubleCollection.cs
- ServiceEndpointElement.cs
- Dump.cs
- RelatedView.cs
- DocumentsTrace.cs
- RuntimeTrackingProfile.cs
- SiteMapNode.cs
- UnsafeCollabNativeMethods.cs
- WindowAutomationPeer.cs
- ProfileModule.cs
- SafeSecurityHelper.cs
- SymbolType.cs
- CompilerError.cs
- NeutralResourcesLanguageAttribute.cs
- DataGridHeaderBorder.cs
- GradientSpreadMethodValidation.cs
- PathBox.cs
- DrawingGroup.cs
- SqlCacheDependencyDatabaseCollection.cs
- UrlMapping.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- Transform3DGroup.cs
- SystemIcmpV6Statistics.cs
- WebConfigurationHostFileChange.cs
- MediaElement.cs
- InstanceDescriptor.cs
- PointLightBase.cs
- FieldNameLookup.cs
- XamlStyleSerializer.cs
- InvokerUtil.cs
- Geometry3D.cs
- ApplicationCommands.cs
- XmlAttributeProperties.cs
- BuildProviderCollection.cs
- RenamedEventArgs.cs
- PageContentCollection.cs
- DrawingCollection.cs
- SchemaAttDef.cs
- IList.cs
- WaitHandleCannotBeOpenedException.cs
- httpstaticobjectscollection.cs
- GetKeyedHashRequest.cs
- FaultReason.cs
- PenContext.cs
- StaticSiteMapProvider.cs
- ToolStripSeparatorRenderEventArgs.cs
- SudsCommon.cs
- BitmapVisualManager.cs
- AsmxEndpointPickerExtension.cs
- Line.cs
- DataGridTableStyleMappingNameEditor.cs
- MdImport.cs
- ApplicationInfo.cs
- TextHidden.cs
- Rights.cs
- SpotLight.cs
- PolyBezierSegment.cs
- RectValueSerializer.cs
- SerializationHelper.cs
- LogicalExpr.cs
- ServiceDefaults.cs
- FontConverter.cs
- MailHeaderInfo.cs
- DispatcherHooks.cs
- DataGridViewRowEventArgs.cs
- DSASignatureDeformatter.cs
- SimpleWebHandlerParser.cs
- MailHeaderInfo.cs
- HtmlElementErrorEventArgs.cs
- RequestSecurityToken.cs
- Material.cs
- CompiledRegexRunner.cs
- OletxDependentTransaction.cs
- CategoryList.cs
- SqlRowUpdatedEvent.cs
- SQLBytes.cs
- xml.cs
- ReadWriteSpinLock.cs
- ConsumerConnectionPoint.cs
- SchemaMerger.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- ResourceCategoryAttribute.cs
- ThreadAttributes.cs
- ToolBar.cs
- Convert.cs
- MaskDescriptors.cs
- Material.cs
- ChannelTerminatedException.cs
- StringBuilder.cs
- ConnectionsZoneDesigner.cs
- Script.cs
- RequestUriProcessor.cs
- OleDbReferenceCollection.cs
- FileAuthorizationModule.cs
- GridViewCellAutomationPeer.cs
- UnescapedXmlDiagnosticData.cs
- JsonGlobals.cs
- XamlPointCollectionSerializer.cs
- WindowsProgressbar.cs
- JavaScriptString.cs