-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Conversation
@safern FYI as I expect this will break coreclr when we open the mirroring PR there. please tag me on that PR when we have it. |
I will. Thanks for letting me know. |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get | ||
{ | ||
// TODO https://github.com/dotnet/corefx/issues/24105: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done and hence the implementation can be cleaned up to be identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool. I'll fix that
/// </summary> | ||
public int Length | ||
{ | ||
[NonVersionable] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we have some properties marked as NonVersionable before?
cc @jkotas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need using System.Runtime.Versioning;
in this file anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is important for R2R code quality (the attribute allows cross-module inlining for these properties). We should keep the attributes for the Fast version.
@@ -112,6 +112,8 @@ | |||
<Compile Include="$(CommonPath)\CoreLib\System\Runtime\InteropServices\MemoryMarshal.cs" /> | |||
<Compile Include="System\ReadOnlySpan.cs" /> | |||
<Compile Include="System\Span.cs" /> | |||
<Compile Include="$(CommonPath)\CoreLib\System\Span.Shared.cs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shared implementation should have no suffix. The fast-span specific implementation should have .Fast.cs suffix. It is the convention that we have been using for this so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will rename the files then.
{Readonly}Span.cs -> {ReadOnly}Span.Fast.cs
{Readonly}Span.Shared.cs -> {Readonly}Span.cs
@jkotas renaming the files as desired confused git. but in general, I didn't change anything in the span code and I should be addressed all comments. other idea would be do the renaming in 2 steps (I mean in 2 PR's) |
I still see |
/// <summary> | ||
/// The number of items in the read-only span. | ||
/// </summary> | ||
public int Length | ||
{ | ||
#if !FEATURE_PORTABLE_SPAN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 ifdefs to shared 150 files. Is it worth it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any future shared code will go to this shared files and hopefully, down the road, we may be able to get rid of the #if's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Down the road, we will likely stop building the slow Span. System.Memory is partial OOB. Once it ships, the surface of the portable version will be locked down. We won't be able to add to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine if you think it is not worth it to split the files and I can close this PR. I don't have a strong feeling about it either. @ahsonkhan asked if we can refactor the common code to the shared place. so, I am fine either way :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong feeling about it either.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, as I have the changes ready and passing the CI, I'll continue with this PR. let me know if you have any more comments before I merge it. thanks for your comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahsonkhan asked if we can refactor the common code to the shared place. so, I am fine either way :-)
I think the enumerator, at the very least, should be shared, since it is already contained enough that it can be extracted out easily.
Down the road, we will likely stop building the slow Span. System.Memory is partial OOB.
Given this, extracting the other common code is less important, but I think it makes maintainability a bit easier.
@@ -112,6 +112,8 @@ | |||
<Compile Include="$(CommonPath)\CoreLib\System\Runtime\InteropServices\MemoryMarshal.cs" /> | |||
<Compile Include="System\ReadOnlySpan.cs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be named .Portable.cs
to follow the naming convention.
LGTM - I don't have any review feedback beyond what has already been provided. |
test NETFX x86 Release Build |
@jkotas are you ok to merge? |
I would wait for the backlog of the CoreCLR Span commits to clear through the mirror before merging this one. Otherwise, I am fine with this. |
31fbfff
to
583f824
Compare
test NETFX x86 Release Build |
the failed test in the CI is tracked by the issue https://github.com/dotnet/corefx/issues/26725 |
@jkotas is it ok to merge now? or there are more changes coming from coreclr? I already merged with the latest we got from coreclr? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it is fine.
The CI results have quite a bit of red though. |
@dotnet-bot test this please |
Actually, I was wrong - there were still pending Span changes waiting to be mirrored. I have just merge them and there is conflict again. I am sorry about the conflicts... |
no worries. I'll try to merge one more time. Thanks @jkotas |
@jkotas can we merge it now? |
The mirror was stuck. There are still pending Span changes in CoreCLR that this will conflict with. If you merge now, you will get conflicts in the mirror job once the mirror starts running again... |
I missed the mirroring part. I'll keep waiting to clear the mirroring and then remerge. |
The machine is not responding and I can't RDP to it. I'm working with the service engineers to get it fixed. I'll keep you guys posted. |
@tarekgh This should be ready for re-merge now. |
thanks @jkotas. I have done the merge. |
The failure in NETFX x86 Release Build is the known issue #26770 |
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com> Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com> Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from dotnet/corefx@a68803c
This change is moving the common span code to a shared files
Fixes #26611