Skip to content

Commit

Permalink
Prepare for 2.3.2 release (#285)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Watson <bewatson@microsoft.com>
  • Loading branch information
benmwatson and Ben Watson authored Mar 2, 2023
1 parent 8695e3d commit 44d6a7d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
25 changes: 25 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# Version 2.3.2

Optimizations:
* Caculating blocks and offsets was made more efficient by using `Math.DivRem`.
* Reading and writing to the stream was made more efficient with fewer array accesses.
* `CopyTo` was overriden to avoid using the slower default implementation.

# Version 2.3.1

New Feature:
* Stream lifetime (creation through dispose) is now tracked and reported through the `MemoryStreamDispose` `EventSource` event, as well as through the `StreamDisposed` .NET event.

Changes:
* The pool statistics used to be reported only when blocks/buffers were returned to the pool. This could lead to lopsided reporting patterns in some cases. Now, pool statistics are reported on stream creation and disposal.
* Added pool stats information to the `MemoryStreamDiscardBuffer` event.
* Changed events relating to buffer creation to be at the warning level instead of verbose. These are signals that the pool might not be large enough to handle the load.

Bug Fixes:
* Fixed allocation/finalization bug that could cause a `NullReferenceException` in some low-memory scenarios.

Internal:
* .NET 7 SDK used to build
* Changed coding style to match some newer patterns (and added .editorconfig file to enforce in the future)
* Fixed punctuation and spelling in API documentation.

# Version 2.2.1

API change:
Expand Down
1 change: 1 addition & 0 deletions docs/Microsoft.IO/RecyclableMemoryStream.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public sealed class RecyclableMemoryStream : MemoryStream, IBufferWriter<byte>
| override [Position](RecyclableMemoryStream/Position.md) { getset; } | Gets the current position in the stream. |
| [Advance](RecyclableMemoryStream/Advance.md)(…) | Notifies the stream that *count* bytes were written to the buffer returned by [`GetMemory`](./RecyclableMemoryStream/GetMemory.md) or [`GetSpan`](./RecyclableMemoryStream/GetSpan.md). Seeks forward by *count* bytes. |
| override [Close](RecyclableMemoryStream/Close.md)() | Equivalent to `Dispose`. |
| override [CopyTo](RecyclableMemoryStream/CopyTo.md)(…) | |
| override [CopyToAsync](RecyclableMemoryStream/CopyToAsync.md)(…) | Asynchronously reads all the bytes from the current position in this stream and writes them to another stream. |
| override [GetBuffer](RecyclableMemoryStream/GetBuffer.md)() | Returns a single buffer containing the contents of the stream. The buffer may be longer than the stream length. |
| [GetMemory](RecyclableMemoryStream/GetMemory.md)(…) | |
Expand Down
12 changes: 12 additions & 0 deletions docs/Microsoft.IO/RecyclableMemoryStream/CopyTo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# RecyclableMemoryStream.CopyTo method

```csharp
public override void CopyTo(Stream destination, int bufferSize)
```

## See Also

* class [RecyclableMemoryStream](../RecyclableMemoryStream.md)
* namespace [Microsoft.IO](../../Microsoft.IO.RecyclableMemoryStream.md)

<!-- DO NOT EDIT: generated by xmldocmd for Microsoft.IO.RecyclableMemoryStream.dll -->
4 changes: 2 additions & 2 deletions src/Microsoft.IO.RecyclableMemoryStream.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;netcoreapp2.1;net5.0</TargetFrameworks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
Expand All @@ -7,7 +7,7 @@
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Microsoft.IO.RecyclableMemoryStream.xml</DocumentationFile>
<!-- NuGet properties -->
<PackageId>Microsoft.IO.RecyclableMemoryStream</PackageId>
<PackageVersion>2.3.1</PackageVersion>
<PackageVersion>2.3.2</PackageVersion>
<Title>Microsoft.IO.RecyclableMemoryStream</Title>
<Authors>Microsoft</Authors>
<Description>A pooled MemoryStream allocator to decrease GC load and improve performance on highly scalable systems.</Description>
Expand Down
6 changes: 3 additions & 3 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -34,8 +34,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.1.0")]
[assembly: AssemblyFileVersion("2.3.1.0")]
[assembly: AssemblyVersion("2.3.2.0")]
[assembly: AssemblyFileVersion("2.3.2.0")]

[assembly: CLSCompliant(true)]

Expand Down

0 comments on commit 44d6a7d

Please sign in to comment.