[php-src] PR #13572: Fix GC buffer unnecessarily grows up to GC_MAX_BUF_SIZE when scanning WeakMaps
| From: | arnaud-lb | Date: | Sat, 02 Mar 2024 12:21:28 +0000 |
| Subject: | [php-src] PR #13572: Fix GC buffer unnecessarily grows up to GC_MAX_BUF_SIZE when scanning WeakMaps | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-25213@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13572
Author: arnaud-lb
This should fix #13569.
This is caused by a wrong condition in
gc_extra_root() causing it to grow the root
buffer when it's not necessary: It grows the buffer when the first_unused slot is
higher or equal to gc_threshold. Additionally, this condition applies repeatedly
because the threshold is (legitimately) not updated in this case, thus the buffer size quickly grows
towards GC_MAX_BUF_SIZE, after which an E_WARNING is triggered and the GC
is disabled.