Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Zend/zend_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,9 @@ static void *zend_mm_alloc_pages(zend_mm_heap *heap, uint32_t pages_count ZEND_F

found:
if (steps > 2 && pages_count < 8) {
ZEND_MM_CHECK(chunk->next->prev == chunk, "zend_mm_heap corrupted");
ZEND_MM_CHECK(chunk->prev->next == chunk, "zend_mm_heap corrupted");

/* move chunk into the head of the linked-list */
chunk->prev->next = chunk->next;
chunk->next->prev = chunk->prev;
Expand Down Expand Up @@ -1116,6 +1119,9 @@ static zend_never_inline void *zend_mm_alloc_large(zend_mm_heap *heap, size_t si

static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_chunk *chunk)
{
ZEND_MM_CHECK(chunk->next->prev == chunk, "zend_mm_heap corrupted");
ZEND_MM_CHECK(chunk->prev->next == chunk, "zend_mm_heap corrupted");

chunk->next->prev = chunk->prev;
chunk->prev->next = chunk->next;
heap->chunks_count--;
Expand Down