[php-src] PR #23745: CLI server: make all heap chunks self contained
| From: | DanielEScherzer | Date: | Fri, 18 Sep 2026 00:35:46 +0000 |
| Subject: | [php-src] PR #23745: CLI server: make all heap chunks self contained | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38549@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23745
Author: DanielEScherzer
For chunks that were pointing to heap data outside of the chunk itself, ASAN would report some
memory leaks. Rather than trying to figure out exactly where the right place to free that data is,
just copy the data into a self-contained chunk. While this might not be the best option from a
performance perspective, the CLI server is meant only as a development tool and accordingly
performance is not a major concern.
The static
php_cli_server_chunk_heap_new() function was removed.
The php_cli_server_chunk.data.heap.block pointer was removed. Now that all heap
allocations are self contained, the block is always the same as the overall chunk; remove the
unneeded field. Additionally, php_cli_server_chunk_dtor(), which only acts for heap
allocations for which the block was different than the chunk, is no longer needed and is removed.