com php-src: document globals accesor macro and tls specifiers: UPGRADING.INTERNALS
| From: | Anatol Belski | Date: | Wed, 29 Jul 2015 15:26:53 +0000 |
| Subject: | com php-src: document globals accesor macro and tls specifiers: UPGRADING.INTERNALS | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88227@lists.php.net to get a copy of this message | ||
Commit: f6d196a38f484603452ca0ffaa241940c452ac99
Author: Anatol Belski <ab@php.net> Wed, 29 Jul 2015 17:26:05 +0200
Parents: 859507c9aff83a9bb1b8e968ad709841f4dc1bef
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f6d196a38f484603452ca0ffaa241940c452ac99
Log:
document globals accesor macro and tls specifiers
Changed paths:
M UPGRADING.INTERNALS
Diff:
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index ce97cba..d0bcafb 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -194,6 +194,26 @@ changes. See: https://wiki.php.net/phpng-upgrading
into the destructor. So the previous example could look like
free(my_struct->vars); given the income was casted to (struct my_struct *).
+ A new macro was introduced to simplify the declaration to the extension
+ globals. A simplified declaration looks as follows
+
+ #define MYEXT_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(myext, v)
+
+ Two new storage specifiers was introduced.
+
+ ZEND_EXT_TLS - expand to an appropriate thread specific storage specifier in
+ the thread safe build, expands to empty in a non thread safe
+ build.
+ ZEND_TLS - expands to an appropriate thread specific storage specifier
+ with static visibility in the thread safe build, expands to
+ an empty string in a non thread safe build.
+
+ Variables declared with these storage specifiers can not be shared across
+ threads. While ZEND_TLS enforces the local scope visibility, ZEND_EXT_TLS
+ pertains to the visiblity across several compilation units. In both cases,
+ there's no portable way to achieve the visibility across shared objects.
+ Thus, these specifiers are not compatible with ZEND_API and PHPAPI specifiers.
+
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