[php-src] PR #16153: Refactor: gc flags and friends
| From: | withinboredom | Date: | Tue, 01 Oct 2024 17:19:47 +0000 |
| Subject: | [php-src] PR #16153: Refactor: gc flags and friends | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28924@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16153
Author: withinboredom
While trying to wrap my head around GC and
GC_FLAGS, I found the current setup a bit
confusing and brittle. For example, if you want to add a new flag, you'll end up with a very
subtle memory leak unless you know to update GC_ADDRESS and how that affects the GC.
Diagnosing this memory leak is not straightforward either.
Thus I set out to refactor the macros here to be a bit easier to tune and comprehend; mostly to
increase my own understanding of the code. I hope that other people might find it valuable as well,
so I also added a full layout explaining more about what is in each part as a hint (depending on why
you find yourself there).