Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Fix #81585: cached_chunks are not counted to real_size on shutdown
This commit is contained in:
Christoph M. Becker 2021-12-10 12:25:30 +01:00
commit 2362722dcf
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
2 changed files with 4 additions and 2 deletions

2
NEWS
View file

@ -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)

View file

@ -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;