Skip to content

Conversation

@kooldev
Copy link

@kooldev kooldev commented Jun 4, 2020

This PR avoids modifications to existing Zend APIs by providing attribute registration functions. This was suggested by @nikic in the attributes v2 PR. All the work is done by zend_add_attribute() and some very small inline helper functions have been added to zend_attributes.h to deal with most common use cases.

The compiler has been adjusted make use of the new API. The changes ensure that all attributes (and arrays) are allocated in zend_attributes.c. This keeps the code in one place. It also enabled me to erase zend_attribute_free() from the public API because it is only needed internally.

@kooldev
Copy link
Author

kooldev commented Jun 4, 2020

@nikic I followed your suggestions and adjusted the code accordingly. I dropped the str-functions from the header, having the returned pointers is enough for attribute registration.

@kooldev
Copy link
Author

kooldev commented Jun 4, 2020

@beberlei Should be ready to merge now. ;-)

@beberlei beberlei merged commit 5572da5 into beberlei:attributes_v2_rfc Jun 4, 2020
@kooldev kooldev deleted the API branch June 4, 2020 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants