Req #80835 [NEW]: suggested code cleanup for ZEND_ENABLE_STATIC_TSRMLS_CACHE

From: Date: Fri, 05 Mar 2021 14:11:39 +0000
Subject: Req #80835 [NEW]: suggested code cleanup for ZEND_ENABLE_STATIC_TSRMLS_CACHE
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232577@lists.php.net to get a copy of this message
From: theultramage at gmail dot com Operating system: FreeBSD 12.2 PHP version: 8.0.3 Package: Unknown/Other Function Bug Type: Feature/Change Request Bug description:suggested code cleanup for ZEND_ENABLE_STATIC_TSRMLS_CACHE Description: ------------ In 2014, a bunch of defines for the experimental TSRM cache were added to zend.h, and across multiple commits, they were applied to the base code and extensions code, as well as their build scripts. https://github.com/php/php-src/commit/76081df168829a5cc0409fac47c217d4927ec6f6 https://github.com/php/php-src/commit/5749b4a9979cd3ff85996323bed9adc1bd182f76 In particular, the ZEND_ENABLE_STATIC_TSRMLS_CACHE define acts as an on/off toggle. And for some reason, the developer decided to add the compiler flag ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 into every possible m4 makefile. I have questions. - Was it necessary to add this level of control over that flag, making a mess in the process? I now suspect that the sole reason it's there is because the developer was going through the extensions one by one, and only wanted to turn the cache defines on after they made the required code edits. In that case, this shim should have been removed before the development branch was merged. - Was it necessary to add a set of wrapper defines to zend.h that just point to tsrm.h? Couldn't this have been contained within tsrm.h, to avoid having to rebrand the TSRM api as ZEND_TSRM through a bunch of cosmetic src edits? All the extensions still #include "TSRM.h", and 18 of those don't even use TSRM. - In several places the work wasn't done, and those still directly use the non-cache TSRM macros. In some others, the code directly calls cache-specific TSRM macros, leading to a compilation error if the cache is disabled. See https://bugs.php.net/bug.php?id=80823 -- Edit bug report at https://bugs.php.net/bug.php?id=80835&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80835&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80835&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80835&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80835&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80835&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80835&r=support Expected behavior: https://bugs.php.net/fix.php?id=80835&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80835&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80835&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80835&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80835&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80835&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80835&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80835&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80835&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80835&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80835&r=mysqlcfg

« previous php.bugs (#232577) next »