Changeset 17
- Timestamp:
- 05/25/2006 04:31:16 AM (7 years ago)
- Files:
-
- 1 modified
-
trunk/xcache.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xcache.c
r11 r17 990 990 static void xc_request_init(TSRMLS_D) /* {{{ */ 991 991 { 992 int i; 993 994 if (xc_php_hcache.size && !XG(php_holds)) { 995 XG(php_holds) = calloc(xc_php_hcache.size, sizeof(xc_stack_t)); 996 for (i = 0; i < xc_php_hcache.size; i ++) { 997 xc_stack_init(&XG(php_holds[i])); 998 } 999 } 1000 1001 if (xc_var_hcache.size && !XG(var_holds)) { 1002 XG(var_holds) = calloc(xc_var_hcache.size, sizeof(xc_stack_t)); 1003 for (i = 0; i < xc_var_hcache.size; i ++) { 1004 xc_stack_init(&XG(var_holds[i])); 1005 } 1006 } 1007 992 1008 if (XG(cacher)) { 993 1009 #if PHP_API_VERSION <= 20041225 … … 1012 1028 static void xc_init_globals(zend_xcache_globals* xc_globals TSRMLS_DC) /* {{{ */ 1013 1029 { 1014 int i; 1015 1016 if (xc_php_hcache.size) { 1017 xc_globals->php_holds = calloc(xc_php_hcache.size, sizeof(xc_stack_t)); 1018 for (i = 0; i < xc_php_hcache.size; i ++) { 1019 xc_stack_init(&xc_globals->php_holds[i]); 1020 } 1021 } 1022 else { 1023 xc_globals->php_holds = NULL; 1024 } 1025 1026 if (xc_var_hcache.size) { 1027 xc_globals->var_holds = calloc(xc_var_hcache.size, sizeof(xc_stack_t)); 1028 for (i = 0; i < xc_var_hcache.size; i ++) { 1029 xc_stack_init(&xc_globals->var_holds[i]); 1030 } 1031 } 1032 else { 1033 xc_globals->var_holds = NULL; 1034 } 1035 1036 #ifdef HAVE_XCACHE_COVERAGE 1037 xc_globals->coverages = NULL; 1038 #endif 1030 memset(xc_globals, 0, sizeof(zend_xcache_globals)); 1039 1031 } 1040 1032 /* }}} */ … … 1540 1532 return; 1541 1533 } 1542 if ( spec <= xc_get_opcode_spec_count()) {1534 if ((zend_uchar) spec <= xc_get_opcode_spec_count()) { 1543 1535 opspec = xc_get_opcode_spec((zend_uchar) spec); 1544 1536 if (opspec) { … … 1792 1784 char *env; 1793 1785 1794 REGISTER_INI_ENTRIES();1795 1796 1786 xc_module_gotup = 1; 1797 1787 if (!xc_zend_extension_gotup) { … … 1802 1792 } 1803 1793 1794 ZEND_INIT_MODULE_GLOBALS(xcache, xc_init_globals, xc_shutdown_globals); 1795 REGISTER_INI_ENTRIES(); 1796 1804 1797 if (strcmp(sapi_module.name, "cli") == 0) { 1805 1798 if ((env = getenv("XCACHE_TEST")) != NULL) { … … 1818 1811 xc_var_size = xc_var_hcache.size = 0; 1819 1812 } 1820 /* xc_init_globals depends on all the aboves */1821 1822 ZEND_INIT_MODULE_GLOBALS(xcache, xc_init_globals, xc_shutdown_globals);1823 1813 1824 1814 original_sigsegv_handler = signal(SIGSEGV, xcache_sigsegv_handler);

