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
- ThreadExceptionEvent.cs
- CultureInfoConverter.cs
- ByteFacetDescriptionElement.cs
- SpecialNameAttribute.cs
- ForAllOperator.cs
- DiscoveryServerProtocol.cs
- ExpressionsCollectionEditor.cs
- SqlGatherConsumedAliases.cs
- FormatControl.cs
- TagPrefixInfo.cs
- ConstructorArgumentAttribute.cs
- VoiceSynthesis.cs
- XamlReaderHelper.cs
- ExpressionPrinter.cs
- Win32.cs
- MergeEnumerator.cs
- SplayTreeNode.cs
- StructuralType.cs
- RijndaelCryptoServiceProvider.cs
- XmlNavigatorStack.cs
- ComPlusInstanceContextInitializer.cs
- DescendantOverDescendantQuery.cs
- FixedSOMPageElement.cs
- StateDesigner.Helpers.cs
- ImageSourceTypeConverter.cs
- RequestQueryProcessor.cs
- RSAPKCS1KeyExchangeFormatter.cs
- EditorPart.cs
- VScrollProperties.cs
- SqlMethodAttribute.cs
- entitydatasourceentitysetnameconverter.cs
- ProfileService.cs
- SiteMapProvider.cs
- RelativeSource.cs
- BuildProvider.cs
- ObjectCloneHelper.cs
- RotateTransform.cs
- DeflateStream.cs
- SkipQueryOptionExpression.cs
- AttributeInfo.cs
- RectKeyFrameCollection.cs
- TemplateColumn.cs
- As.cs
- XmlResolver.cs
- HttpRequestCacheValidator.cs
- TemplateField.cs
- SwitchDesigner.xaml.cs
- DesignColumn.cs
- WebHttpDispatchOperationSelectorData.cs
- SqlRowUpdatingEvent.cs
- WriteableOnDemandStream.cs
- Misc.cs
- XmlSignatureManifest.cs
- HtmlImage.cs
- ImageCodecInfoPrivate.cs
- SignatureToken.cs
- MetadataPropertyvalue.cs
- OleDbError.cs
- InvalidPipelineStoreException.cs
- BamlRecordWriter.cs
- ServicePoint.cs
- FormsAuthenticationUserCollection.cs
- DesignBindingPropertyDescriptor.cs
- HttpsHostedTransportConfiguration.cs
- ApplicationInfo.cs
- TemplateLookupAction.cs
- InputLanguageProfileNotifySink.cs
- PackageDigitalSignature.cs
- DefaultIfEmptyQueryOperator.cs
- Dictionary.cs
- DataGridDesigner.cs
- StrongNameMembershipCondition.cs
- FileEnumerator.cs
- CacheOutputQuery.cs
- Dump.cs
- RegistrySecurity.cs
- TextControl.cs
- MethodBuilder.cs
- SignatureToken.cs
- ObjectDataSourceMethodEventArgs.cs
- AnnotationResourceChangedEventArgs.cs
- ReverseInheritProperty.cs
- CodeObject.cs
- UiaCoreTypesApi.cs
- ImageSource.cs
- CultureSpecificStringDictionary.cs
- ListItemCollection.cs
- HtmlContainerControl.cs
- XmlNode.cs
- QualificationDataItem.cs
- Attributes.cs
- TraceLevelStore.cs
- Material.cs
- ProviderMetadata.cs
- XmlValidatingReader.cs
- UserControlBuildProvider.cs
- AuthenticateEventArgs.cs
- ExtensionSimplifierMarkupObject.cs
- Visitor.cs
- WindowsGraphicsWrapper.cs