Skip to content
Prev Previous commit
Next Next commit
Apply suggestions from code review
  • Loading branch information
jkotas authored Mar 31, 2024
commit 7434c154fea6ab234b22b49117b72f74ece3b7f3
6 changes: 2 additions & 4 deletions src/coreclr/vm/gchelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,7 @@ OBJECTREF TryAllocateFrozenSzArray(MethodTable* pArrayMT, INT32 cElements)

if (pArrayMT->ContainsPointers() && cElements > 0)
{
// We cannot allocate in the frozen heap if:
// - the array type is collectible
// - or for non empty arrays with GC pointers
// For arrays with GC pointers we can only work with empty arrays
return NULL;
}

Expand Down Expand Up @@ -1124,7 +1122,7 @@ OBJECTREF TryAllocateFrozenObject(MethodTable* pObjMT)

SetTypeHandleOnThreadForAlloc(TypeHandle(pObjMT));

if (pObjMT->Collectible() || pObjMT->ContainsPointers() || pObjMT->IsComObjectType())
if pObjMT->ContainsPointers() || pObjMT->IsComObjectType())
{
return NULL;
}
Expand Down