[php-src] PR #25583: Fix GH-25555: Set memory_consumption when loading file_cache script into SHM
| From: | prateekbhujel | Date: | Thu, 19 Nov 2026 11:12:20 +0000 |
| Subject: | [php-src] PR #25583: Fix GH-25555: Set memory_consumption when loading file_cache script into SHM | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40807@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25583
Author: prateekbhujel
When a script is written to
opcache.file_cache without being stored in shared memory
(because SHM was full or opcache.file_cache_only=1 was used),
script->dynamic_members.memory_consumption in the serialized .bin file
is 0.
When zend_file_cache_script_load_ex() later loads that .bin into shared
memory (cache_it == true), set script->dynamic_members.memory_consumption =
ZEND_ALIGNED_SIZE(script->size) so opcache_get_status() reports the allocated
SHM size and invalidation accounts for it in wasted_memory.
Fixes GH-25555.