add ZTS globals for userland comparator callbacks

This commit is contained in:
CismonX 2018-08-14 19:55:37 +08:00
parent a3b35a865e
commit a5119e597d
3 changed files with 21 additions and 0 deletions

View File

@ -22,6 +22,8 @@ zend_class_entry* collections_pair_ce;
zend_string* collections_pair_first;
zend_string* collections_pair_second;
ZEND_DECLARE_MODULE_GLOBALS(collections)
PHP_MINIT_FUNCTION(collections)
{
collections_pair_first = zend_string_init("first", sizeof "first" - 1, 1);

View File

@ -123,6 +123,9 @@
return; \
}
#define FCI_G COLLECTIONS_G(fci)
#define FCC_G COLLECTIONS_G(fcc)
/// Unused global variable.
zval rv;

View File

@ -25,6 +25,22 @@ extern zend_module_entry collections_module_entry;
#define GC_DELREF(p) --GC_REFCOUNT(p)
#endif
ZEND_BEGIN_MODULE_GLOBALS(collections)
zend_fcall_info* fci;
zend_fcall_info_cache* fcc;
ZEND_END_MODULE_GLOBALS(collections)
ZEND_EXTERN_MODULE_GLOBALS(collections)
#ifdef ZTS
#ifdef COMPILE_DL_COLLECTIONS
ZEND_TSRMLS_CACHE_EXTERN()
#endif
#define COLLECTIONS_G(v) TSRMG(collections_globals_id, zend_collections_globals*, v)
#else
#define COLLECTIONS_G(v) (collections_globals.v)
#endif
extern PHP_COLLECTIONS_API zend_class_entry* collections_collection_ce;
extern PHP_COLLECTIONS_API zend_class_entry* collections_pair_ce;