Changeset 588
Legend:
- Unmodified
- Added
- Removed
-
trunk/utils.c
r555 r588 595 595 #endif 596 596 597 static void xc_copy_zend_constant(zend_constant *c) /* {{{ */ 598 { 599 c->name = zend_strndup(c->name, c->name_len - 1); 600 if (!(c->flags & CONST_PERSISTENT)) { 601 zval_copy_ctor(&c->value); 602 } 603 } 604 /* }}} */ 597 605 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */ 598 606 { … … 632 640 h = OG(zend_constants); 633 641 zend_hash_init_ex(&TG(zend_constants), 20, NULL, h->pDestructor, h->persistent, h->bApplyProtection); 642 { 643 zend_constant tmp_const; 644 zend_hash_copy(&TG(zend_constants), &XG(internal_constant_table), (copy_ctor_func_t) xc_copy_zend_constant, (void *) &tmp_const, sizeof(tmp_const)); 645 } 634 646 #endif 635 647 h = OG(function_table); … … 679 691 /* Using ZEND_COMPILE_IGNORE_INTERNAL_CLASSES for ZEND_FETCH_CLASS_RT_NS_CHECK 680 692 */ 681 CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_ DELAYED_BINDING;693 CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_DELAYED_BINDING; 682 694 #endif 683 695 … … 698 710 699 711 #ifdef HAVE_XCACHE_CONSTANT 700 b = TG(zend_constants).pListHead;712 b = /*TG(internal_constant_tail) ? TG(internal_constant_tail)->pListNext :*/ TG(zend_constants).pListHead; 701 713 /* install constants */ 702 714 while (b != NULL) { -
trunk/utils.h
r548 r588 95 95 HashTable tmp_class_table; 96 96 HashTable tmp_auto_globals; 97 #ifdef HAVE_XCACHE_CONSTANT 98 Bucket *tmp_internal_constant_tail; 99 #endif 97 100 Bucket *tmp_internal_function_tail; 98 101 Bucket *tmp_internal_class_tail; -
trunk/xcache.c
r572 r588 1849 1849 } 1850 1850 /* }}} */ 1851 static void xc_copy_zend_constant(zend_constant *c) /* {{{ */ 1852 { 1853 c->name = zend_strndup(c->name, c->name_len - 1); 1854 if (!(c->flags & CONST_PERSISTENT)) { 1855 zval_copy_ctor(&c->value); 1856 } 1857 } 1858 /* }}} */ 1851 1859 static void xc_request_init(TSRMLS_D) /* {{{ */ 1852 1860 { … … 1854 1862 1855 1863 if (!XG(internal_table_copied)) { 1864 #ifdef HAVE_XCACHE_CONSTANT 1865 zend_constant tmp_const; 1866 #endif 1856 1867 zend_function tmp_func; 1857 1868 xc_cest_t tmp_cest; 1858 1869 1870 #ifdef HAVE_XCACHE_CONSTANT 1871 zend_hash_destroy(&XG(internal_constant_table)); 1872 #endif 1859 1873 zend_hash_destroy(&XG(internal_function_table)); 1860 1874 zend_hash_destroy(&XG(internal_class_table)); 1861 1875 1876 #ifdef HAVE_XCACHE_CONSTANT 1877 zend_hash_init_ex(&XG(internal_constant_table), 20, NULL, NULL, 1, 0); 1878 #endif 1862 1879 zend_hash_init_ex(&XG(internal_function_table), 100, NULL, NULL, 1, 0); 1863 1880 zend_hash_init_ex(&XG(internal_class_table), 10, NULL, NULL, 1, 0); 1864 1881 1882 #ifdef HAVE_XCACHE_CONSTANT 1883 zend_hash_copy(&XG(internal_constant_table), EG(zend_constants), (copy_ctor_func_t) xc_copy_zend_constant, &tmp_const, sizeof(tmp_const)); 1884 #endif 1865 1885 zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &tmp_func, sizeof(tmp_func)); 1866 1886 zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &tmp_cest, sizeof(tmp_cest)); … … 1921 1941 memset(xcache_globals, 0, sizeof(zend_xcache_globals)); 1922 1942 1943 #ifdef HAVE_XCACHE_CONSTANT 1944 zend_hash_init_ex(&xcache_globals->internal_constant_table, 1, NULL, NULL, 1, 0); 1945 #endif 1923 1946 zend_hash_init_ex(&xcache_globals->internal_function_table, 1, NULL, NULL, 1, 0); 1924 1947 zend_hash_init_ex(&xcache_globals->internal_class_table, 1, NULL, NULL, 1, 0); … … 1952 1975 1953 1976 if (xcache_globals->internal_table_copied) { 1977 #ifdef HAVE_XCACHE_CONSTANT 1978 zend_hash_destroy(&xcache_globals->internal_constant_table); 1979 #endif 1954 1980 zend_hash_destroy(&xcache_globals->internal_function_table); 1955 1981 zend_hash_destroy(&xcache_globals->internal_class_table); -
trunk/xcache_globals.h
r508 r588 22 22 #endif 23 23 24 #ifdef HAVE_XCACHE_CONSTANT 25 HashTable internal_constant_table; 26 #endif 24 27 HashTable internal_function_table; 25 28 HashTable internal_class_table;
Note: See TracChangeset
for help on using the changeset viewer.

