-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Remove syncroot fields from collections #34198
Conversation
|
Some tests to fix. |
|
OrderedDictionary and LinkedList neglected to mark their |
|
Hmm, it did break one serialization test, I will revert |
src/System.ObjectModel/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs
Outdated
Show resolved
Hide resolved
| private ValueList valueList; // Do not rename (binary serialization) | ||
| [NonSerialized] | ||
| private object _syncRoot; | ||
| private object _syncRoot; // Serialized indirectly in SyncSortedList |
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 is the indirect serialization a problem?
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.
It's not. It does however mean that if you change the type of it, the binary format of SyncSortedList changes, causing our tests to break. I am not sure whether that would break cross version serialization. See note above.
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.
And of course if you stored something in there that wasn't binary serializable, it would be a break.
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 not sure whether that would break cross version serialization.
I do not think it would break 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.
OK, but it would if I changed SortedList to put something unserializable in here, so a comment seemed useful.
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 do not understand ... if you delete this field and just return this from SyncRoot, everything should still work fine.
Yes, the blob will be different but that should be ok.
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.
Alright will do
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.
Mind if I do that in a follow up? Updating the binary blobs causes many other updates that I don't understand yet. I need to talk to @ViktorHofer
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
When you implement ISerializable, the |
Yes, but I am not sure that is true for Data Contract Serialization. |
|
Any more feedback? |
jkotas
left a comment
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.
Looks good to me
* Syncroot * Fix typo in build-native * Specialized * Remove noise * Revert non generic SortedList * Test fixups * CLR test fixes * Revert "CLR test fixes" This reverts commit 8db135c. * Disable syncroot tests for NETFX * Update QueueTests.cs * Test fixes * Typo (cherry picked from commit 1fd3717) Porting above changes from master sans changes to Build.cmd and Build-Native.cmd
* Syncroot * Fix typo in build-native * Specialized * Remove noise * Revert non generic SortedList * Test fixups * CLR test fixes * Revert "CLR test fixes" This reverts commit dotnet/corefx@8db135c. * Disable syncroot tests for NETFX * Update QueueTests.cs * Test fixes * Typo Commit migrated from dotnet/corefx@1fd3717
CoreFX part of https://github.com/dotnet/corefx/issues/34149.
This is everything save (1) immutable collections, which I don't want to mess with (2) some marginal types and legacy libraries.
Also fix a typo in build-native.cmd.