Skip to content

Commit c3e3d35

Browse files
committed
[MERGE chakra-core#2533 @leirocks] avoid going through the list while page heap allocating
Merge pull request chakra-core#2533 from leirocks:pageheapfix reduce the chance of hanging
2 parents fa03139 + 3f6ea24 commit c3e3d35

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

lib/Common/Memory/LargeHeapBucket.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,8 @@ LargeHeapBucket::PageHeapAlloc(Recycler * recycler, size_t sizeCat, size_t size,
196196
char * memBlock = heapBlock->Alloc(size, attributes);
197197
Assert(memBlock != nullptr);
198198

199-
200-
if (this->largePageHeapBlockList)
201-
{
202-
HeapBlockList::Tail(this->largePageHeapBlockList)->SetNextBlock(heapBlock);
203-
}
204-
else
205-
{
206-
this->largePageHeapBlockList = heapBlock;
207-
}
199+
heapBlock->SetNextBlock(this->largePageHeapBlockList);
200+
this->largePageHeapBlockList = heapBlock;
208201

209202
#if ENABLE_PARTIAL_GC
210203
recycler->autoHeap.uncollectedNewPageCount += pageCount;

0 commit comments

Comments
 (0)