Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Mirror changes from dotnet/corefx - #15909

Merged
tarekgh merged 4 commits into
masterfrom
mirror-merge-9492524
Jan 18, 2018
Merged

Mirror changes from dotnet/corefx#15909
tarekgh merged 4 commits into
masterfrom
mirror-merge-9492524

Conversation

@dotnet-bot

Copy link
Copy Markdown

This PR contains mirrored changes from dotnet/corefx

Please REBASE this PR when merging

* Consolidate System.Memory code to shared folder

This change is removing the duplicate codes from System.Memory and keep only one copy under the shared folder to be easier to edit such code in one place and get reflected on the other repos.

* Address the review feedback

* Addressing more feedback

* More cleanup

* remove empty line and added a comment

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
@jkotas

jkotas commented Jan 18, 2018

Copy link
Copy Markdown
Member

@dotnet-bot test Tizen armel Cross Checked Innerloop Build and Test please
@dotnet-bot test Ubuntu arm Cross Debug Innerloop Build please

if (IsDisposed)
{
ThrowHelper.ThrowObjectDisposedException(nameof(OwnedMemory<T>), ExceptionResource.Memory_ThrowIfDisposed);
ThrowHelper.ThrowObjectDisposedException_MemoryDisposed(nameof(OwnedMemory<T>));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Bit odd to have a unique exception handler; then add a chunky nameof(OwnedMemory<T>) param?

@tarekgh tarekgh Jan 18, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general, I think we'll need to do some clean up for the exceptions and using ThrowHelper. I hope at some point we'll have a shared ThrowHelper across repos too and revisit what parameters every helper method is using.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we'll have a shared ThrowHelper across repos too

The eventual solution should be to have IL rewriter or some similar tech to do this optimization for you. ThrowHelper is a pain to maintain. Until we have automated way to do this, we want to use only in the places that really matter. We do not want to share accross repos.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tarekgh I think @benaadams has valid point. We should move the chunky name into the throw helper and not pass it as an argument. You can append a commit to this PR to fix it - the mirror will then mirror it back to CoreFX.

@tarekgh

tarekgh commented Jan 18, 2018

Copy link
Copy Markdown
Member

test Tizen armel Cross Checked Innerloop Build and Test
test Ubuntu arm Cross Debug Innerloop Build
test Ubuntu16.04 arm Cross Debug Innerloop Build

@tarekgh
tarekgh merged commit d44f3e8 into master Jan 18, 2018
dotnet-bot added a commit to dotnet/corert that referenced this pull request Jan 18, 2018
* Consolidate System.Memory code to shared folder (dotnet/corefx#26393)

* Consolidate System.Memory code to shared folder

This change is removing the duplicate codes from System.Memory and keep only one copy under the shared folder to be easier to edit such code in one place and get reflected on the other repos.

* Address the review feedback

* Addressing more feedback

* More cleanup

* remove empty line and added a comment

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>

* Add missing throw helper methods used in the code we got from corefx

* Update the exception helper

* fix the break
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
@tarekgh

tarekgh commented Jan 18, 2018

Copy link
Copy Markdown
Member

@safern I forgot to rebase when merging. instead, I did squash it. is this going to cause a problem for the mirroring? sorry about that. I can revert and resubmit if needed.

<data name="Marshaler_StringTooLong" xml:space="preserve">
<value>Marshaler restriction: Excessively long string.</value>
</data>
<data name="MemoryDisposed" xml:space="preserve">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This string is redundant with Memory_ThrowIfDisposed.

InvalidOperation_HandleIsNotInitialized,
AsyncMethodBuilder_InstanceNotInitialized,
ArgumentNull_SafeHandle,
MemoryDisposed,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is redundant with Memory_ThrowIfDisposed field

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll submit a PR to fix this. thanks for the catch

jkotas pushed a commit to dotnet/corert that referenced this pull request Jan 19, 2018
* Consolidate System.Memory code to shared folder (dotnet/corefx#26393)

* Consolidate System.Memory code to shared folder

This change is removing the duplicate codes from System.Memory and keep only one copy under the shared folder to be easier to edit such code in one place and get reflected on the other repos.

* Address the review feedback

* Addressing more feedback

* More cleanup

* remove empty line and added a comment

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>

* Add missing throw helper methods used in the code we got from corefx

* Update the exception helper

* fix the break
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
@safern

safern commented Jan 19, 2018

Copy link
Copy Markdown
Member

Yes it will cause the mirror to get stuck, because of the commit created will not have the signature and will try to mirror it back and there will me conflicts when trying to do so. I will fix the mirror though, no worries :)

@MichalStrehovsky
MichalStrehovsky deleted the mirror-merge-9492524 branch January 19, 2018 09:34
@tarekgh

tarekgh commented Jan 19, 2018

Copy link
Copy Markdown
Member

#15928

@tarekgh

tarekgh commented Jan 19, 2018

Copy link
Copy Markdown
Member

@safern let me know when you fix the mirroring as I am expecting we'll need to do a small change in corefx to let the code exactly match.

@safern

safern commented Jan 22, 2018

Copy link
Copy Markdown
Member

@tarekgh fixed!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants