Hello, for two separate reasons I was recently reviewing
zend_module_entry's layout and usage and there are two things I don't
understand:

 1. Why does zend_module_entry have a `.size` member, if it's not
actually used anywhere as far as I can tell from both reading code and
setting debugger watchpoints? One place it probably _ought_ to be used
is when we copy the module entry in `zend_register_module_ex`
(https://heap.space/xref/php-src/Zend/zend_API.c?r=733023b2#2381), but
`sizeof(zend_module_entry)` is used instead.
 2. Why do we copy the module entry in `zend_register_module_ex`
anyway? I've dug through git history a bit but haven't found anything
notable so far. It seems like we should store the parameter and
document it needing to have a static lifetime (or a heap-allocated
lifetime which just leaks), which would satisfy both get_module() and
the hybrid extension/zend_extension hacks.

In any case, the particular combination of these two points makes it
seem like something is broken, wrong, or obsolete and needs to be
documented as such. I am hoping someone here knows the history or
background on this!

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to