Changeset 92 in svn


Ignore:
Timestamp:
2006-07-16T08:33:59+02:00 (9 years ago)
Author:
Xuefer
Message:

PHP_5_2: auto module_global is maintained by php engine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r91 r92  
    10631063}
    10641064/* }}} */
    1065 static void xc_init_globals(zend_xcache_globals* xc_globals TSRMLS_DC) /* {{{ */
    1066 {
    1067     memset(xc_globals, 0, sizeof(zend_xcache_globals));
    1068 }
    1069 /* }}} */
    1070 static void xc_shutdown_globals(zend_xcache_globals* xc_globals TSRMLS_DC) /* {{{ */
     1065/* {{{ PHP_GINIT_FUNCTION(xcache) */
     1066static
     1067#ifdef PHP_GINIT_FUNCTION
     1068PHP_GINIT_FUNCTION(xcache)
     1069#else
     1070void xc_init_globals(zend_xcache_globals* xcache_globals TSRMLS_DC)
     1071#endif
     1072{
     1073    memset(xcache_globals, 0, sizeof(zend_xcache_globals));
     1074}
     1075/* }}} */
     1076/* {{{ PHP_GSHUTDOWN_FUNCTION(xcache) */
     1077static
     1078#ifdef PHP_GSHUTDOWN_FUNCTION
     1079PHP_GSHUTDOWN_FUNCTION(xcache)
     1080#else
     1081void xc_shutdown_globals(zend_xcache_globals* xcache_globals TSRMLS_DC)
     1082#endif
    10711083{
    10721084    int i;
    10731085
    1074     if (xc_globals->php_holds != NULL) {
     1086    if (xcache_globals->php_holds != NULL) {
    10751087        for (i = 0; i < xc_php_hcache.size; i ++) {
    1076             xc_stack_destroy(&xc_globals->php_holds[i]);
    1077         }
    1078         free(xc_globals->php_holds);
    1079         xc_globals->php_holds = NULL;
    1080     }
    1081 
    1082     if (xc_globals->var_holds != NULL) {
     1088            xc_stack_destroy(&xcache_globals->php_holds[i]);
     1089        }
     1090        free(xcache_globals->php_holds);
     1091        xcache_globals->php_holds = NULL;
     1092    }
     1093
     1094    if (xcache_globals->var_holds != NULL) {
    10831095        for (i = 0; i < xc_var_hcache.size; i ++) {
    1084             xc_stack_destroy(&xc_globals->var_holds[i]);
    1085         }
    1086         free(xc_globals->var_holds);
    1087         xc_globals->var_holds = NULL;
     1096            xc_stack_destroy(&xcache_globals->var_holds[i]);
     1097        }
     1098        free(xcache_globals->var_holds);
     1099        xcache_globals->var_holds = NULL;
    10881100    }
    10891101}
     
    19851997    }
    19861998
     1999#ifndef PHP_GINIT
    19872000    ZEND_INIT_MODULE_GLOBALS(xcache, xc_init_globals, xc_shutdown_globals);
     2001#endif
    19882002    REGISTER_INI_ENTRIES();
    19892003
     
    20602074        xc_coredump_dir = NULL;
    20612075    }
    2062 #ifdef ZTS
     2076#ifndef PHP_GINIT
     2077#   ifdef ZTS
    20632078    ts_free_id(xcache_globals_id);
    2064 #else
     2079#   else
    20652080    xc_shutdown_globals(&xcache_globals TSRMLS_CC);
     2081#   endif
    20662082#endif
    20672083
     
    21082124    PHP_MINFO(xcache),
    21092125    XCACHE_VERSION,
     2126#ifdef PHP_GINIT
     2127    PHP_MODULE_GLOBALS(xcache),
     2128    PHP_GINIT(xcache),
     2129    PHP_GSHUTDOWN(xcache),
     2130#endif
    21102131#ifdef ZEND_ENGINE_2
    21112132    ZEND_MODULE_POST_ZEND_DEACTIVATE_N(xcache),
Note: See TracChangeset for help on using the changeset viewer.