Skip to content

Commit cc90de0

Browse files
authored
Add asserts on GC compaction (#3050)
***NO_CI***
1 parent d7bad19 commit cc90de0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/CLR/Core/GarbageCollector_Compaction.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,16 @@ void CLR_RT_GarbageCollector::Heap_Compact()
256256

257257
freeRegion->Unlink();
258258

259+
#ifdef _DEBUG
260+
261+
_ASSERTE(relocCurrent->m_destination >= (CLR_UINT8 *)g_CLR_RT_ExecutionEngine.m_heap.FirstNode());
262+
_ASSERTE(relocCurrent->m_destination < (CLR_UINT8 *)g_CLR_RT_ExecutionEngine.m_heap.LastNode());
263+
_ASSERTE(relocCurrent->m_start >= (CLR_UINT8 *)g_CLR_RT_ExecutionEngine.m_heap.FirstNode());
264+
_ASSERTE(relocCurrent->m_start < (CLR_UINT8 *)g_CLR_RT_ExecutionEngine.m_heap.LastNode());
265+
_ASSERTE(moveBytes <= freeRegion_Size);
266+
267+
#endif
268+
259269
memmove(relocCurrent->m_destination, relocCurrent->m_start, moveBytes);
260270

261271
if (freeRegion_Size)

0 commit comments

Comments
 (0)