Skip to content

Conversation

@Tyrrrz
Copy link
Owner

@Tyrrrz Tyrrrz commented Dec 2, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 2, 2025 18:19
@Tyrrrz Tyrrrz added the enhancement New feature or request label Dec 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive polyfills for memory-related types (Span<T>, Memory<T>, ReadOnlySpan<T>, ReadOnlyMemory<T>, ArrayPool<T>, MemoryPool<T>, MemoryMarshal, MemoryExtensions, and StandardFormat) to enable modern .NET APIs on older frameworks. The PR also removes signature-compatible array-based replacements in favor of proper Span/Memory implementations and modernizes test code with collection expressions.

Key changes:

  • Implements core memory types with array-backed storage for older framework compatibility
  • Removes temporary array-based method signatures in favor of proper Span/Memory overloads
  • Updates documentation examples to demonstrate async enumerable usage instead of memory APIs

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
Readme.md Updates example code to showcase async enumerable features; updates package versions
PolyShim/Signatures.md Documents new memory-related types and extension methods; updates total signature counts
PolyShim/NetCore21/Span.cs New polyfill providing Span<T> with array-backed storage
PolyShim/NetCore21/ReadOnlySpan.cs New polyfill providing ReadOnlySpan<T> with array-backed storage
PolyShim/NetCore21/Memory.cs New polyfill providing Memory<T> wrapper around arrays
PolyShim/NetCore21/ReadOnlyMemory.cs New polyfill providing ReadOnlyMemory<T> wrapper around arrays
PolyShim/NetCore21/MemoryExtensions.cs New extension methods for arrays, spans, and strings to enable memory operations
PolyShim/NetCore21/MemoryMarshal.cs New utility class for low-level memory operations
PolyShim/NetCore21/MemoryPool.cs New polyfill for MemoryPool<T> with simple non-pooling implementation
PolyShim/NetCore21/StandardFormat.cs New struct for standard formatting specifications
PolyShim/NetCore21/IMemoryOwner.cs New interface for memory ownership pattern
PolyShim/NetCore10/ArrayPool.cs New polyfill for ArrayPool<T> with simple non-pooling implementation
PolyShim/NetCore21/StreamWriter.cs Removes conditional compilation guards now that memory types are always available
PolyShim/NetCore21/StreamReader.cs Removes array-based signature-compatible methods, keeps only Span/Memory versions
PolyShim/NetCore21/Stream.cs Removes array-based signature-compatible methods, keeps only Span/Memory versions
PolyShim/NetCore21/Random.cs Removes conditional compilation guards for memory-dependent methods
PolyShim/Net70/Stream.cs Removes array-based signature-compatible methods for read operations
PolyShim/Net100/Random.cs Removes array-based GetString method, delegates to Span version
PolyShim.Tests/PolyShim.Tests.csproj Removes explicit System.Memory and System.ValueTuple package references
PolyShim.Tests/NetCore21/*.cs Renames test methods and modernizes with collection expression syntax
PolyShim.Tests/Net70/StreamTests.cs Modernizes test assertions with collection expression syntax
PolyShim.Tests/Net90/FileTests.cs Modernizes test code with collection expression syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Tyrrrz and others added 3 commits December 2, 2025 20:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Tyrrrz Tyrrrz changed the title Add polyfills for Span<T>, Memory<T>, ArrayPool<T>, MemoryPool<T>, and all auxillary types Add polyfills for Span<T>, Memory<T>, ArrayPool<T>, MemoryPool<T>, and all auxiliary types Dec 2, 2025
Tyrrrz and others added 3 commits December 2, 2025 20:50
…add-span-memory-polyfills

# Conflicts:
#	PolyShim/NetCore21/StandardFormat.cs
@Tyrrrz Tyrrrz requested a review from Copilot December 2, 2025 21:47
@Tyrrrz Tyrrrz changed the title Add polyfills for Span<T>, Memory<T>, ArrayPool<T>, MemoryPool<T>, and all auxiliary types Add polyfills for Span<T>, Memory<T>, ArrayPool<T>, MemoryPool<T>, and related types Dec 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Tyrrrz Tyrrrz requested a review from Copilot December 2, 2025 22:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated 12 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants