[php-src] PR #12240: Zend: Move FCI/FCC/callables related functions to a dedicated header and C file
| From: | Girgias | Date: | Mon, 18 Sep 2023 14:03:13 +0000 |
| Subject: | [php-src] PR #12240: Zend: Move FCI/FCC/callables related functions to a dedicated header and C file | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23628@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12240
Author: Girgias
This groups all related functions into one C file and gives a good overview of the API via the
header, instead of it being spread around multiple different files.
I am currently not sure if I should not move `
zend_fcc_addref() and
zend_call_known_fcc() to the .c` file to reduce some
header inclusions, as I'm not entirely sure if it makes a lot of sense for them to be always
inlined.
## Primary motivation
Having the FCI and FCC structures in their own header to be able to include them in
`zend_gc.h to be able to move
zend_get_gc_buffer_add_fcc() into zend_gc.h` as it is
otherwise not very discoverable.
## Future scope
Making the `zend_is_callable_ex() private as it is only used by
zend_call_function(), the non ex variant is used
twice in php-src, however the PCNTL usage is bogus (as it doesn't do anything) and the usage in
sapi_windows_set_ctrl_handler() is about not being able to attach the
function, and could possibly be changed to be generic. Meaning, we could possibly also drop the non
ex` variant.
Another thing would be to drop the rather confusing FCI API which I started in #9723
One minor thing that may also be useful, is to drop the dependency on `zend_API.h
in the .c` file to not have a circular dependency.