diff --git a/src/collections.c b/src/collections.c index 0c00a03..88d7c46 100644 --- a/src/collections.c +++ b/src/collections.c @@ -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); diff --git a/src/collections_methods.c b/src/collections_methods.c index f0c9a2c..08853ba 100644 --- a/src/collections_methods.c +++ b/src/collections_methods.c @@ -123,6 +123,9 @@ return; \ } +#define FCI_G COLLECTIONS_G(fci) +#define FCC_G COLLECTIONS_G(fcc) + /// Unused global variable. zval rv; diff --git a/src/php_collections.h b/src/php_collections.h index a5d4bdc..896ef30 100644 --- a/src/php_collections.h +++ b/src/php_collections.h @@ -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;