Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into orgpal-mesh
  • Loading branch information
actions-user committed Oct 11, 2023
2 parents 2535bc4 + 8bc42da commit 9aa3770
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/CLR/Core/CLR_RT_HeapCluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ CLR_RT_HeapBlock *CLR_RT_HeapCluster::ExtractBlocks(CLR_UINT32 dataType, CLR_UIN
if (available >= length)
{
res = ptr;

_ASSERTE((void *)res >= (void *)s_CLR_RT_Heap.m_location);
_ASSERTE((void *)res < (void *)(s_CLR_RT_Heap.m_location + s_CLR_RT_Heap.m_size));

break;
}
}
Expand All @@ -120,18 +124,29 @@ CLR_RT_HeapBlock *CLR_RT_HeapCluster::ExtractBlocks(CLR_UINT32 dataType, CLR_UIN

available -= length;

_ASSERTE((void *)next >= (void *)s_CLR_RT_Heap.m_location);
_ASSERTE((void *)next < (void *)(s_CLR_RT_Heap.m_location + s_CLR_RT_Heap.m_size));
_ASSERTE((void *)prev >= (void *)s_CLR_RT_Heap.m_location);
_ASSERTE((void *)prev < (void *)(s_CLR_RT_Heap.m_location + s_CLR_RT_Heap.m_size));

if (available != 0)
{
if (flags & CLR_RT_HeapBlock::HB_Event)
{
res->SetDataId(CLR_RT_HEAPBLOCK_RAW_ID(DATATYPE_FREEBLOCK, CLR_RT_HeapBlock::HB_Pinned, available));

res += available;

_ASSERTE((void *)res >= (void *)s_CLR_RT_Heap.m_location);
_ASSERTE((void *)res < (void *)(s_CLR_RT_Heap.m_location + s_CLR_RT_Heap.m_size));
}
else
{
CLR_RT_HeapBlock_Node *ptr = &res[length];

_ASSERTE((void *)ptr >= (void *)s_CLR_RT_Heap.m_location);
_ASSERTE((void *)ptr < (void *)(s_CLR_RT_Heap.m_location + s_CLR_RT_Heap.m_size));

//
// Relink to the new free block.
//
Expand Down

0 comments on commit 9aa3770

Please sign in to comment.