This repository was archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 344
Conversation
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
I'm not a fan of this. Move those methods to corefx proper before breaking this package. |
Yeah, if the APIs are used by pipelines, and we know they have benefits, we should just have them in SpanExtensions. BTW, I think it would be ok to move the APIs to SpanExtensions without proving they have benefits (perf) and measure later. Otherwise the PR looks good. |
Looks good. Thanks! |
Ah, I think I merged Ben's rename and now there is a conflict. @ahsonkhan, could you please resolve and then just merge? Thanks. |
@KrzysztofCwalina, resolved the conflicts. |
halter73
added a commit
to aspnet/KestrelHttpServer
that referenced
this pull request
Mar 23, 2017
halter73
pushed a commit
to aspnet/KestrelHttpServer
that referenced
this pull request
Mar 23, 2017
- Removed use of TryRead and follow the pin and use pattern in the other APIs dotnet/corefxlab#1348
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.
Working towards - #1314 / #1292
Move to System.Binary
Moved to SpanExtensions: (PR Adding Span.StartsWith corefx#17322)
Move to BuffersExtension in experimental
public static int IndexOf(this ReadOnlySpan buffer, byte value0, byte value1);public static int IndexOf(this ReadOnlySpan buffer, byte value0, byte value1, byte value2);public static int IndexOf(this Span buffer, byte value0, byte value1);public static int IndexOf(this Span buffer, byte value0, byte value1, byte value2);Remove (this should be on ArraySegment)
Delete:
NOTE:
Moving the following to
System.Buffers.Experimental\System\Buffers\BufferExtensions.cs
causesSystem.IO.Pipelines
to take a dependency onSystem.Buffers.Experimental
.The IndexOf with multiple byte values are used in
ReadCursorOperations.Seek
, here:https://github.com/aspnet/KestrelHttpServer/blob/f6e5e74d9551df57effda19c856352608374cee7/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/KestrelHttpParser.cs#L273
This function is implemented here:
corefxlab/src/System.IO.Pipelines/ReadCursorOperations.cs
Line 32 in 3bd0ffd
What should we do about this dependency? This is the only that System.IO.Pipelines depends on Buffers.Experimental.
If we remove those Seek overloads (and the one reference to it in kestrel), we could remove this dependency.
Edit:
Adding back IndexOf overloads to SpanExtensionsLab (in Buffes.Primitives). Will remove them once they are ported over to corefx (in System.Memory.dll).