com php-src: some more UPGRADING INTERNALS notes: UPGRADING.INTERNALS

From: Date: Mon, 23 Mar 2015 14:50:13 +0000
Subject: com php-src: some more UPGRADING INTERNALS notes: UPGRADING.INTERNALS
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85821@lists.php.net to get a copy of this message
Commit: 4dc69709e2a7e8bd933e8a8bfd7ee5a6d9715d63 Author: Anatol Belski <ab@php.net> Mon, 23 Mar 2015 15:50:13 +0100 Parents: 429c8715b24e9ba04aaf4234afabb4d9a181f5d9 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4dc69709e2a7e8bd933e8a8bfd7ee5a6d9715d63 Log: some more UPGRADING INTERNALS notes Changed paths: M UPGRADING.INTERNALS Diff: diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index c3fd4c6..0273215 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -77,8 +77,8 @@ PHP 7.0 INTERNALS UPGRADE NOTES 'u', 'x' or 'o'. The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases - they can use the implemenations available on the system, not the PHP one. Fro snprintf the - the macros ZEND_INT_FMT ZEND_UINT_FMT should be used. + they can use the implemenations available on the system, not the PHP one. With snprintf the + macros ZEND_INT_FMT and ZEND_UINT_FMT should be used. h. HashTable API @@ -106,6 +106,10 @@ PHP 7.0 INTERNALS UPGRADE NOTES - ZEND_ULONG_MAX replaces ULONG_MAX where appropriate - SIZEOF_ZEND_LONG reworked SIZEOF_ZEND_LONG representing the size of zend_long datatype - ZEND_SIZE_MAX Max value of size_t + - Z_L casts an integral constant to zend_long + - Z_U casts an integral constant to zend_ulong + + The macro ZEND_ENABLE_ZVAL_LONG64 reveals whether zval operates on 64 or 32 bit integer. k. The get_class_entry object handler is no longer available. Instead zend_object.ce is always used. @@ -166,10 +170,17 @@ PHP 7..0 INTERNALS UPGRADE NOTES Porting an extension or SAPI is usually as easy as removing all the TSRMLS_* ocurrences and integrating the macros mentioned above. However if tsrm_ls - is used explicitly, its usage can considered obsolete in most cases. + is used explicitly, its usage can be considered obsolete in most cases. Additionally, if an extension triggers its own threads, TSRMLS_CACHE shouldn't be passed to that threads directly. + When working with CTOR/DTOR for the extension globals, only the data passed + as parameters should be touched. For example, don't use code like + free(MYEXT_G(vars)); inside globals destructor, as it possibly can destroy + the data from a wrong thread. Instead use the pointer to the data delivered + into the destructor. So the previous example could look like + free(my_struct->vars); given the income was casted to (struct my_struct *). + q. gc_collect_cycles() is now a function pointer, and can be replaced in the same manner as zend_execute_ex() if needed (for example, to include the time spent in the garbage collector in a profiler). The default

« previous php.cvs (#85821) next »