php-memory-profiler icon indicating copy to clipboard operation
php-memory-profiler copied to clipboard

ZTS build not supported ...

Open mcarbonneaux opened this issue 7 years ago • 5 comments

when i build the module they throw the error "ZTS build not supported (yet)"... there a plan to support ? what they need to do to work ?

mcarbonneaux avatar Aug 23 '18 17:08 mcarbonneaux

i've made a 1st pull request on v1.0.0 and v2.0.0 for that....

and remi as done another pull request:

  • https://github.com/arnaud-lb/php-memory-profiler/pull/7

mcarbonneaux avatar Aug 23 '18 20:08 mcarbonneaux

do you have plans to support ZTS builds? I think it is a very common way to build php.

mokraemer avatar Mar 30 '21 07:03 mokraemer

What are the obstacles to supporting the extension on ZTS? I'd like to be able to use it with PocketMine-MP, which requires threading extensions that require ZTS.

dktapps avatar Nov 04 '23 18:11 dktapps

https://github.com/arnaud-lb/php-memory-profiler/pull/7#issuecomment-25978263

from @arnaud-lb in the pull request of remi :

There will be a limitation in ZTS however, as we cannot override zend_execute_fn / zend_execute_internal during script execution without affecting scripts running in other threads. In ZTS mode we will have to override them permanently (in MINIT), and add a is_enabled() check in memprof_zend_execute / memprof_zend_execute_internal.

mcarbonneaux avatar Nov 04 '23 19:11 mcarbonneaux

Might be worth looking into PHP 8.0 Observer API. Not sure if that's thread-local though.

dktapps avatar Nov 05 '23 09:11 dktapps