Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3947,7 +3947,7 @@ internal object GetUninitializedObject()
}

// We reuse ActivatorCache here to ensure that we aren't always creating two entries in the cache.
object? obj = GetOrCreateCacheEntry<ActivatorCache>().CreateUninitializedObject(this);
object? obj = cache.CreateUninitializedObject(this);
try
{
cache.CallRefConstructor(obj);
Expand All @@ -3967,11 +3967,7 @@ internal void CallDefaultStructConstructor(ref byte data)
{
Debug.Assert(IsValueType);

if (GenericCache is not ActivatorCache cache)
{
cache = new ActivatorCache(this);
GenericCache = cache;
}
ActivatorCache cache = GetOrCreateCacheEntry<ActivatorCache>();

if (!cache.CtorIsPublic)
{
Expand Down