-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Split headers, part 2 #10657
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
Split headers, part 2 #10657
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a while to go through the commit list to see the point in the header splits.
Not a massive fan of having that single header for zend_uchar
tho, seems rather pointless.
Me neither. But
|
`zend_uchar` suggests that the value is an ASCII character, but here, it's about very small integers. This is misleading, so let's use a C99 integer instead. On all architectures currently supported by PHP, `zend_uchar` and `uint8_t` are identical. This change is only about code readability.
`zend_rc_debug` is not a type and does not really belong in `zend_types.h`; this allows using `ZEND_RC_MOD_CHECK()` without including the huge `zend_types.h` header and allows decoupling circular header dependencies.
This allows using `ZEND_RC_MOD_CHECK()` without including any additional headers. Performance is not relevant here because this is a debug-only feature. The `zend_refcounted_h` forward declaration is necessary to break a circular header dependency.
More decoupling of circular header dependencies.
This is necessary for splitting `zend_types.h` further.
Prepare to fix the cyclic header dependency from `zend_string.h`.
It is now possible to include only `zend_string.h` without `zend_types.h`.
3f0367f
to
adee720
Compare
Thanks for merging #10621 - rebased this PR (dropping the first commit), fixed the coding style issue, and ready for "real" review now! (As usual, I prefer to not squash for merging, or else this will leave a big messy patch in the git history. My PRs are consumed best as-is.) |
Doing a quick git grep, seems like most of the remaining usages of |
Maybe, once all the complex stuff has been moved out of |
That one I'm not planning on squashing to keep the commits atomic, the previous ones were similar enough in what they were doing that I don't think squashing them is that harmful. :) |
And in |
More like #10609 implementing the RFC vote https://wiki.php.net/rfc/include_cleanup to reduce header dependencies. This also allows converting lots of preprocessor macros to inline functions (which improves debugging - macros cannot be debugged, and macros are error prone). This wasn't possible previously because those macros could only be expanded after including a full set of headers, and due to circular header dependencies, these couldn't be made available just from
zend_string.h
.