Browse Source

!19 !fixed 修复静态编译问题

* 修复静态编译时宏重复定义问题
* !optimize 时间追平漂移量时,损耗一点时间(微妙级别)降低CPU占用
master
微希夷 yitter 2 years ago
parent
commit
43c5cc450f
2 changed files with 4 additions and 4 deletions
  1. +2
    -4
      PHP/php_snowdrift.h
  2. +2
    -0
      PHP/snowdrift.c

+ 2
- 4
PHP/php_snowdrift.h View File

@@ -51,6 +51,8 @@ extern zend_module_entry snowdrift_module_entry;
#define ZEND_ACC_DTOR 0 #define ZEND_ACC_DTOR 0
#endif #endif


#define SD_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(snowdrift, v)

ZEND_BEGIN_MODULE_GLOBALS(snowdrift) ZEND_BEGIN_MODULE_GLOBALS(snowdrift)
uint8_t Method; uint8_t Method;
uint64_t BaseTime; uint64_t BaseTime;
@@ -64,10 +66,6 @@ uint8_t Multi;


ZEND_END_MODULE_GLOBALS(snowdrift) ZEND_END_MODULE_GLOBALS(snowdrift)


ZEND_DECLARE_MODULE_GLOBALS(snowdrift)

#define SD_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(snowdrift, v)

#if defined(ZTS) && defined(COMPILE_DL_SNOWDRIFT) #if defined(ZTS) && defined(COMPILE_DL_SNOWDRIFT)
ZEND_TSRMLS_CACHE_EXTERN() ZEND_TSRMLS_CACHE_EXTERN()
#endif #endif


+ 2
- 0
PHP/snowdrift.c View File

@@ -38,6 +38,8 @@ zend_class_entry snowdrift_ce;


static uint16_t wid_num = 0; static uint16_t wid_num = 0;


ZEND_DECLARE_MODULE_GLOBALS(snowdrift)

/* {{{ PHP_INI */ /* {{{ PHP_INI */


PHP_INI_BEGIN() PHP_INI_BEGIN()


Loading…
Cancel
Save