Skip to content

Zend: Remove dependency on zend.h for certain headers #12166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Sep 9, 2023

Allows to move AST definitions out from zend_compile.h and into zend_ast.h

The motivation for this is to be able to move the FCC/FCI struct declarations and the relevant functions into their own header, so that it can be included in zend_gc.h and move zend_get_gc_buffer_add_fcc() from Zend_API.h to zend_gc.h.

However, currently zend_gc.h does not depend on zend.h and I don't think it should, however OBJ_RELEASE() which is used by zend_fcc_dtor() (which would logically be moved to the new header for FCI/FCC strucs) means it would have a dependency on Zend/zend_objects_API.h thus the starting point for the dependency reduction.

Allows to move AST definitions out from zend_compile.h and into zend_ast.h
@Girgias Girgias force-pushed the zend-header-dependency-reduction branch from c6bc5d6 to 44e77f7 Compare September 9, 2023 23:09
@Girgias Girgias marked this pull request as ready for review September 10, 2023 00:10
@Girgias Girgias requested a review from dstogov as a code owner September 10, 2023 00:10
Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see problems

@Girgias Girgias merged commit 5c3a6ea into php:master Sep 11, 2023
@MaxKellermann
Copy link
Contributor

I welcome this change, because it follows the spirit of https://wiki.php.net/rfc/include_cleanup but it is surprising that this PR got merged, even though similar PRs from me were rejected.

@MaxKellermann
Copy link
Contributor

Note that this PR adds a comment to an #include line:

#include "zend_compile.h" /* For zend_property_info */

This was also something I proposed in https://wiki.php.net/rfc/include_cleanup but 90% of all voters rejected this idea, saying it should not be "allowed to document an #include line with a code comment". @dstogov also rejected this.
@dstogov, did you miss this part of the PR?

@Girgias Girgias deleted the zend-header-dependency-reduction branch July 7, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants