This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Add Memory.Pin() to eventually replace Memory.Retain(bool)#28517
Closed
ahsonkhan wants to merge 4 commits into
Closed
Add Memory.Pin() to eventually replace Memory.Retain(bool)#28517ahsonkhan wants to merge 4 commits into
ahsonkhan wants to merge 4 commits into
Conversation
stephentoub
reviewed
Mar 27, 2018
| public static void MemoryFromEmptyArrayRetainWithPinning() | ||
| { | ||
| Memory<int> memory = new int[0]; | ||
| MemoryHandle handle = memory.Retain(pin: true); |
Member
There was a problem hiding this comment.
Why are we adding tests for a method that's going away?
Author
There was a problem hiding this comment.
This is just a reorder to be consistent and makes things easier (avoiding copy/paste errors).
stephentoub
reviewed
Mar 27, 2018
| <Compile Include="ReadOnlyMemory\Equality.cs" /> | ||
| <Compile Include="ReadOnlyMemory\GetHashCode.cs" /> | ||
| <Compile Include="ReadOnlyMemory\ImplicitConversion.cs" /> | ||
| <Compile Include="ReadOnlyMemory\Pin.cs" /> |
Member
There was a problem hiding this comment.
corefx itself uses Retain in a bunch of places. Can those be switched over to Pin in this PR as well?
joshfree
approved these changes
Mar 27, 2018
davidfowl
reviewed
Mar 28, 2018
| { | ||
| public static partial class MemoryTests | ||
| { | ||
|
|
GrabYourPitchforks
approved these changes
Mar 28, 2018
KrzysztofCwalina
approved these changes
Mar 28, 2018
Author
|
@dotnet-bot test this please |
Author
|
Merged the commits from here into #28534. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on: dotnet/coreclr#17269
cc @KrzysztofCwalina, @jkotas, @davidfowl, @stephentoub, @dotnet/corefxlab-contrib