Skip to content

Commit 2362722

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

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PHP NEWS
99
. Fixed bug #81656 (GCC-11 silently ignores -R). (Michael Wallner)
1010
. Fixed bug #81683 (Misleading "access type ... must be public" error message
1111
on final or abstract interface methods). (ilutov)
12+
. Fixed bug #81585 (cached_chunks are not counted to real_size on shutdown).
13+
(cmb)
1214

1315
- MBString:
1416
. Fixed bug #81693 (mb_check_encoding(7bit) segfaults). (cmb)

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)