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
- EncodingDataItem.cs
- SafeNativeMethods.cs
- Debugger.cs
- RowToParametersTransformer.cs
- SqlEnums.cs
- autovalidator.cs
- CultureInfoConverter.cs
- ToolStripScrollButton.cs
- RTTrackingProfile.cs
- PropertyConverter.cs
- GenericRootAutomationPeer.cs
- DataSourceHelper.cs
- Journal.cs
- NotifyIcon.cs
- DesignTimeTemplateParser.cs
- RuleProcessor.cs
- QueuePathEditor.cs
- ToolStripPanelCell.cs
- VirtualDirectoryMapping.cs
- DesignerCapabilities.cs
- ServiceObjectContainer.cs
- ServiceNotStartedException.cs
- _ChunkParse.cs
- ByeMessageApril2005.cs
- KoreanCalendar.cs
- Rotation3D.cs
- NameTable.cs
- RelationshipDetailsCollection.cs
- StylusPointProperty.cs
- SqlStatistics.cs
- Win32SafeHandles.cs
- DataGridViewCellStyle.cs
- RuleSetBrowserDialog.cs
- DataTableClearEvent.cs
- EmptyStringExpandableObjectConverter.cs
- ControlCachePolicy.cs
- ChannelBinding.cs
- SafeLibraryHandle.cs
- CollectionDataContract.cs
- AppDomainShutdownMonitor.cs
- FilterableAttribute.cs
- FileEnumerator.cs
- LinqDataSourceView.cs
- SecurityContext.cs
- ObsoleteAttribute.cs
- Publisher.cs
- DataTableReaderListener.cs
- NullableDecimalAverageAggregationOperator.cs
- WebPartsPersonalization.cs
- TraceListener.cs
- NumberFormatter.cs
- DbExpressionVisitor_TResultType.cs
- StatusBarAutomationPeer.cs
- GestureRecognizer.cs
- Vector3DAnimation.cs
- CacheRequest.cs
- ReadWriteSpinLock.cs
- DrawingContext.cs
- BinarySerializer.cs
- HitTestWithGeometryDrawingContextWalker.cs
- WebScriptMetadataFormatter.cs
- TargetControlTypeAttribute.cs
- DropDownButton.cs
- XLinq.cs
- Dump.cs
- CardSpaceException.cs
- NameSpaceExtractor.cs
- Html32TextWriter.cs
- QilReplaceVisitor.cs
- JsonWriterDelegator.cs
- GroupBoxAutomationPeer.cs
- SHA384.cs
- FrameworkName.cs
- CollectionEditorDialog.cs
- FixedTextContainer.cs
- SwitchLevelAttribute.cs
- TextEndOfLine.cs
- IsolatedStorageFilePermission.cs
- Table.cs
- _ShellExpression.cs
- SqlCacheDependencyDatabaseCollection.cs
- HttpEncoder.cs
- ListViewUpdateEventArgs.cs
- InvalidCommandTreeException.cs
- NativeWindow.cs
- CodeSubDirectory.cs
- UnmanagedMarshal.cs
- SiteMapSection.cs
- SHA1.cs
- FontFamilyValueSerializer.cs
- cookie.cs
- MonitorWrapper.cs
- XmlText.cs
- BuilderPropertyEntry.cs
- HyperLinkStyle.cs
- SqlSelectStatement.cs
- UpdateInfo.cs
- DefaultAuthorizationContext.cs
- NativeCppClassAttribute.cs
- ViewStateModeByIdAttribute.cs