]> granicus.if.org Git - php/commitdiff
improve ZEND_MODULE_GLOBALS_BULK macro, fix data type
authorAnatol Belski <ab@php.net>
Thu, 23 Jun 2016 14:47:04 +0000 (16:47 +0200)
committerAnatol Belski <ab@php.net>
Thu, 23 Jun 2016 14:47:04 +0000 (16:47 +0200)
Zend/zend_API.h
Zend/zend_execute_API.c

index 34612f879f274c8639defbed4a3aa7d8fab6efa9..77127afa4bdf8ac09b4636d21ce23cee6e04d3dc 100644 (file)
@@ -158,7 +158,11 @@ typedef struct _zend_fcall_info_cache {
 #define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor)      \
        ts_allocate_id(&module_name##_globals_id, sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
 #define ZEND_MODULE_GLOBALS_ACCESSOR(module_name, v) ZEND_TSRMG(module_name##_globals_id, zend_##module_name##_globals *, v)
+#if ZEND_ENABLE_STATIC_TSRMLS_CACHE
+#define ZEND_MODULE_GLOBALS_BULK(module_name) TSRMG_BULK_STATIC(module_name##_globals_id, zend_##module_name##_globals *)
+#else
 #define ZEND_MODULE_GLOBALS_BULK(module_name) TSRMG_BULK(module_name##_globals_id, zend_##module_name##_globals *)
+#endif
 
 #else
 
index a914ae221a273b757d7c60774c7134cb20df9a5d..d3dac690ca10a3671d25b095e092ddd6c21d439a 100644 (file)
@@ -1262,7 +1262,7 @@ VOID CALLBACK tq_timer_cb(PVOID arg, BOOLEAN timed_out)
 
 static void zend_set_timeout_ex(zend_long seconds, int reset_signals) /* {{{ */
 {
-       zend_execute_data *eg;
+       zend_executor_globals *eg;
 
 #ifdef ZEND_WIN32
        if(!seconds) {
@@ -1282,13 +1282,7 @@ static void zend_set_timeout_ex(zend_long seconds, int reset_signals) /* {{{ */
        }
 
        /* XXX passing NULL means the default timer queue provided by the system is used */
-#ifndef ZTS
-       eg = &execute_data;
-#elif defined(ZEND_ENABLE_STATIC_TSRMLS_CACHE)
-       eg = TSRMG_BULK_STATIC(executor_globals_id, zend_executor_globals *)
-#else
-       eg = TSRMG_BULK(executor_globals_id, zend_executor_globals *)
-#endif
+       eg = ZEND_MODULE_GLOBALS_BULK(executor);
        if (!CreateTimerQueueTimer(&tq_timer, NULL, (WAITORTIMERCALLBACK)tq_timer_cb, (VOID*)eg, seconds*1000, 0, WT_EXECUTEONLYONCE)) {
                tq_timer = NULL;
                zend_error_noreturn(E_ERROR, "Could not queue new timer");