diff --git a/NEWS b/NEWS index d8df7d0ed50..daaa3611eee 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ PHP NEWS . Fixed bug #81656 (GCC-11 silently ignores -R). (Michael Wallner) . Fixed bug #81683 (Misleading "access type ... must be public" error message on final or abstract interface methods). (ilutov) + . Fixed bug #81585 (cached_chunks are not counted to real_size on shutdown). + (cmb) - MBString: . Fixed bug #81693 (mb_check_encoding(7bit) segfaults). (cmb) diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 6af234b4d75..04b1a4ff19d 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2304,10 +2304,10 @@ void zend_mm_shutdown(zend_mm_heap *heap, bool full, bool silent) #endif memset(heap->free_slot, 0, sizeof(heap->free_slot)); #if ZEND_MM_STAT || ZEND_MM_LIMIT - heap->real_size = ZEND_MM_CHUNK_SIZE; + heap->real_size = (heap->cached_chunks_count + 1) * ZEND_MM_CHUNK_SIZE; #endif #if ZEND_MM_STAT - heap->real_peak = ZEND_MM_CHUNK_SIZE; + heap->real_peak = (heap->cached_chunks_count + 1) * ZEND_MM_CHUNK_SIZE; #endif heap->chunks_count = 1; heap->peak_chunks_count = 1;