Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs')
-rw-r--r--src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs
index 315e0f9d2..271ec8cef 100644
--- a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs
+++ b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs
@@ -1944,19 +1944,11 @@ namespace Internal.Runtime.TypeLoader
if (floatingCells == null)
return IntPtr.Zero;
- // First, check if the current version of the existing floating dictionary matches the version in the native layout. If so, there
- // is no need to allocate anything new, and we can just use the existing statically compiled floating portion of the input dictionary.
-
- // If the fixed dictionary claims to have a floating section
+ // If the floating section is already constructed, then return. This means we are beaten by another thread.
if (*((IntPtr*)fixedDictionary) != IntPtr.Zero)
{
- int currentFloatingVersion = (int)(((IntPtr*)fixedDictionary)[floatingVersionCellIndex]);
-
- if (currentFloatingVersion == floatingVersionInLayout)
- {
- isNewlyAllocatedDictionary = false;
- return fixedDictionary + IntPtr.Size * floatingVersionCellIndex;
- }
+ isNewlyAllocatedDictionary = false;
+ return *((IntPtr*)fixedDictionary);
}
GenericTypeDictionary floatingDict = new GenericTypeDictionary(floatingCells);