1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 16:08:35 +02:00

Stop copying zend_module_entry (#8551)

I did some historical digging and could not figure out why a copy is
made. Additionally, the copy was not using the `.size` member, so it
was probably wrong, but it's been that way for quite some time.
This commit is contained in:
Levi Morrison
2022-05-24 09:13:38 -06:00
committed by GitHub
parent cf971a1401
commit b63df3ce0e
3 changed files with 2 additions and 4 deletions
+1
View File
@@ -20,6 +20,7 @@ PHP 8.2 INTERNALS UPGRADE NOTES
* php_stristr() no longer lowercases the haystack and needle as a side effect.
Call zend_str_tolower() yourself if necessary. You no longer need to copy
the haystack and needle before passing them to php_stristr().
* zend_register_module_ex() no longer copies the module entry.
========================
2. Build system changes
-2
View File
@@ -841,9 +841,7 @@ static void php_scanner_globals_ctor(zend_php_scanner_globals *scanner_globals_p
static void module_destructor_zval(zval *zv) /* {{{ */
{
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(zv);
module_destructor(module);
free(module);
}
/* }}} */
+1 -2
View File
@@ -2378,7 +2378,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len);
lcname = zend_new_interned_string(lcname);
if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) == NULL) {
if ((module_ptr = zend_hash_add_ptr(&module_registry, lcname, module)) == NULL) {
zend_error(E_CORE_WARNING, "Module \"%s\" is already loaded", module->name);
zend_string_release(lcname);
return NULL;
@@ -3061,7 +3061,6 @@ ZEND_API void zend_post_deactivate_modules(void) /* {{{ */
break;
}
module_destructor(module);
free(module);
zend_string_release_ex(key, 0);
} ZEND_HASH_MAP_FOREACH_END_DEL();
} else {