Skip to content

Commit

Permalink
Fix si.ibAllocated in FrozenObjectHeapManager (#92023)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Sep 14, 2023
1 parent adb0250 commit 62e50b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/coreclr/vm/frozenobjectheap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ void FrozenObjectSegment::RegisterOrUpdate(uint8_t* current, size_t sizeCommited
segment_info si;
si.pvMem = m_pStart;
si.ibFirstObject = sizeof(ObjHeader);
si.ibAllocated = (size_t)current;
si.ibAllocated = (size_t)current - (size_t)si.pvMem;
si.ibCommit = sizeCommited;
si.ibReserved = m_Size;

assert((size_t)current >= (size_t)si.pvMem);

// NOTE: RegisterFrozenSegment may take a GC lock inside.
m_SegmentHandle = GCHeapUtilities::GetGCHeap()->RegisterFrozenSegment(&si);
if (m_SegmentHandle == nullptr)
Expand Down

0 comments on commit 62e50b6

Please sign in to comment.