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

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;