mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Fix #81585: cached_chunks are not counted to real_size on shutdown
The amount of allocated system memory is kept in `real_size`, including the allocated `cached_chunks`. Thus, we need to keep the proper count at the end of the shutdown. Closes GH-7745.
This commit is contained in:
parent
0ac3d78d7d
commit
5675ebe649
2
NEWS
2
NEWS
@ -4,6 +4,8 @@ PHP NEWS
|
||||
|
||||
- Core:
|
||||
. Fixed bug #81656 (GCC-11 silently ignores -R). (Michael Wallner)
|
||||
. Fixed bug #81585 (cached_chunks are not counted to real_size on shutdown).
|
||||
(cmb)
|
||||
|
||||
- Spl:
|
||||
. Fixed bug #75917 (SplFileObject::seek broken with CSV flags). (Aliaksandr
|
||||
|
@ -2303,10 +2303,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;
|
||||
|
Loading…
Reference in New Issue
Block a user