Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / IO / Packaging / TrackingMemoryStreamFactory.cs / 1305600 / TrackingMemoryStreamFactory.cs
//------------------------------------------------------------------------------ // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This is a basic implementation of the ITrackingMemoryStreamFactory interface // // History: // 07/4/2005: IgorBel: Initial creation. // 11/08/2005: BruceMac: Change namespace // //----------------------------------------------------------------------------- using System; using System.IO; using System.Diagnostics; namespace MS.Internal.IO.Packaging { ////// TrackingMemoryStreamFactory class is used in the Sparse Memory Stream to keep track of the memory Usage /// internal class TrackingMemoryStreamFactory : ITrackingMemoryStreamFactory { public MemoryStream Create() { return new TrackingMemoryStream((ITrackingMemoryStreamFactory)this); } public MemoryStream Create(int capacity) { return new TrackingMemoryStream((ITrackingMemoryStreamFactory)this, capacity); } public void ReportMemoryUsageDelta(int delta) { checked{_bufferedMemoryConsumption += delta;} Debug.Assert(_bufferedMemoryConsumption >=0, "we end up having buffers of negative size"); } internal long CurrentMemoryConsumption { get { return _bufferedMemoryConsumption; } } private long _bufferedMemoryConsumption; } } // 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
- HttpListenerResponse.cs
- LambdaCompiler.Generated.cs
- filewebresponse.cs
- DataSourceViewSchemaConverter.cs
- ServiceDescriptionData.cs
- ResourcesGenerator.cs
- XmlUnspecifiedAttribute.cs
- CodeDomLocalizationProvider.cs
- XmlAttributeCache.cs
- RuntimeEnvironment.cs
- Internal.cs
- LinqDataSourceDisposeEventArgs.cs
- DynamicQueryStringParameter.cs
- CustomAttributeBuilder.cs
- PenLineJoinValidation.cs
- Clock.cs
- sortedlist.cs
- Memoizer.cs
- XmlSchemaSequence.cs
- PropertyBuilder.cs
- ModelServiceImpl.cs
- Partitioner.cs
- Point3DKeyFrameCollection.cs
- ResourceManagerWrapper.cs
- XmlChoiceIdentifierAttribute.cs
- MultiTrigger.cs
- TypeViewSchema.cs
- _HTTPDateParse.cs
- RequestCacheValidator.cs
- BitmapEffectRenderDataResource.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- GridLengthConverter.cs
- InkCanvasFeedbackAdorner.cs
- AccessibilityHelperForXpWin2k3.cs
- QilGeneratorEnv.cs
- TypeValidationEventArgs.cs
- AutomationElementCollection.cs
- Bezier.cs
- UncommonField.cs
- BooleanStorage.cs
- SettingsPropertyValue.cs
- DataObjectFieldAttribute.cs
- FunctionMappingTranslator.cs
- Assembly.cs
- XmlAnyAttributeAttribute.cs
- DocumentXPathNavigator.cs
- TextElementEditingBehaviorAttribute.cs
- RuntimeResourceSet.cs
- HttpWebRequestElement.cs
- SafeCoTaskMem.cs
- CompositeFontInfo.cs
- altserialization.cs
- StrongNameKeyPair.cs
- SqlDataSourceEnumerator.cs
- DetailsViewUpdateEventArgs.cs
- NotSupportedException.cs
- GeometryDrawing.cs
- NoClickablePointException.cs
- SelectionRange.cs
- SingleAnimationUsingKeyFrames.cs
- CatalogPartCollection.cs
- UIElement3DAutomationPeer.cs
- TraceRecords.cs
- DataComponentGenerator.cs
- ToolboxBitmapAttribute.cs
- GetWinFXPath.cs
- SqlDataReaderSmi.cs
- XmlSerializerAssemblyAttribute.cs
- Utils.cs
- SectionUpdates.cs
- RewritingProcessor.cs
- CorrelationTokenTypeConvertor.cs
- WebPartDescriptionCollection.cs
- StrokeNodeData.cs
- SiteMapHierarchicalDataSourceView.cs
- PropertyEntry.cs
- cookiecollection.cs
- ServiceNameCollection.cs
- ReceiveMessageContent.cs
- Splitter.cs
- Pair.cs
- PerSessionInstanceContextProvider.cs
- XmlChildNodes.cs
- _ScatterGatherBuffers.cs
- WindowsSlider.cs
- SubclassTypeValidatorAttribute.cs
- SpecialFolderEnumConverter.cs
- ClientConfigurationHost.cs
- SHA384Managed.cs
- HashJoinQueryOperatorEnumerator.cs
- HiddenField.cs
- ImmComposition.cs
- documentsequencetextcontainer.cs
- Validator.cs
- ChangeTracker.cs
- StatusBar.cs
- SolidBrush.cs
- XNameConverter.cs
- HttpSysSettings.cs
- TableParaClient.cs