You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve the performance of ConditionalWeakTable.TryGetValue (#80059)
* [NativeAOT] Fix Objective-C reference tracking
Fixes#80032
* Move implementation-specific comment out of public doc comment
* Duplicate code for TryGetHashCode implementations.
* Replace comments with a passing test.
* Add moke test for restricted callouts.
* Remove TryGetHashCode from Mono
It does not guarantee that hash codes are non-zero.
* Add test coverage for untracked objective objects.
* Implement RuntimeHelpers.TryGetHashCode for Mono
* Remove unneeded MONO_COMPONENT_API
* Remove Mono intrinsic for InternalGetHashCode
This is dead code because this method no longer lives on
System.Object.
* Move interpreter transforms to correct class.
* Rename and move icall to match convention.
Co-authored-by: Jan Kotas <[email protected]>
Copy file name to clipboardExpand all lines: src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,19 @@ public static unsafe int GetHashCode(object o)
104
104
returnObjectHeader.GetHashCode(o);
105
105
}
106
106
107
+
/// <summary>
108
+
/// If a hash code has been assigned to the object, it is returned. Otherwise zero is
109
+
/// returned.
110
+
/// </summary>
111
+
/// <remarks>
112
+
/// The advantage of this over <see cref="GetHashCode" /> is that it avoids assigning a hash
113
+
/// code to the object if it does not already have one.
114
+
/// </remarks>
115
+
internalstaticintTryGetHashCode(objecto)
116
+
{
117
+
returnObjectHeader.TryGetHashCode(o);
118
+
}
119
+
107
120
[Obsolete("OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.")]
0 commit comments