Skip to content

Conversation

@Lillenne
Copy link
Contributor

Closes #742

Overview

Memory2D<T> and ReadOnlyMemory2D<T> instances created from a MemoryManager calculate the offset field in units of T instead of byte in the constructor. Since this fix in v8.2.1 where Span creation was changed to Unsafe.AddByteOffset, this causes incorrect indexing into the span.

Fixes were added for NET6 or greater.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • Tested code with current supported SDKs
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Code follows all style conventions

@Lillenne
Copy link
Contributor Author

@dotnet-policy-service agree

1 similar comment
@Lillenne
Copy link
Contributor Author

@dotnet-policy-service agree

Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

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

Thank you! 🙂

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

Labels

bugfix 🔧 PRs fixing a discovered bug high-performance 🚂 Issues/PRs for the HighPerformance package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error When Creating Memory2D from MemoryManager with Offset

2 participants