Skip to content

Commit 4013ebe

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Fix #81585: cached_chunks are not counted to real_size on shutdown
2 parents abcf683 + 2362722 commit 4013ebe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,10 +2304,10 @@ void zend_mm_shutdown(zend_mm_heap *heap, bool full, bool silent)
23042304
#endif
23052305
memset(heap->free_slot, 0, sizeof(heap->free_slot));
23062306
#if ZEND_MM_STAT || ZEND_MM_LIMIT
2307-
heap->real_size = ZEND_MM_CHUNK_SIZE;
2307+
heap->real_size = (heap->cached_chunks_count + 1) * ZEND_MM_CHUNK_SIZE;
23082308
#endif
23092309
#if ZEND_MM_STAT
2310-
heap->real_peak = ZEND_MM_CHUNK_SIZE;
2310+
heap->real_peak = (heap->cached_chunks_count + 1) * ZEND_MM_CHUNK_SIZE;
23112311
#endif
23122312
heap->chunks_count = 1;
23132313
heap->peak_chunks_count = 1;

0 commit comments

Comments
 (0)