未验证 提交 5c02390c 编写于 作者: G github-actions[bot] 提交者: GitHub

[release/8.0] Fix si.ibAllocated in FrozenObjectHeapManager (#92052)

* Fix si.ibAllocated in FrozenObjectHeapManager

* Add an assert

---------
Co-authored-by: NEgorBo <egorbo@gmail.com>
上级 1978fc29
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册