Changeset 681
- Timestamp:
- 09/08/2009 05:17:51 AM (4 years ago)
- Files:
-
- 1 modified
-
trunk/utils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/utils.c
r679 r681 641 641 { 642 642 assert((c->flags & CONST_PERSISTENT)); 643 #ifdef IS_UNICODE 644 c->name.u = zend_ustrndup(c->name.u, c->name_len - 1); 645 #else 646 c->name = zend_strndup(c->name, c->name_len - 1); 647 #endif 643 ZSTR_U(c->name) = UNISW(zend_strndup, zend_ustrndup)(ZSTR_U(c->name), c->name_len - 1); 648 644 } 649 645 /* }}} */ 650 646 void xc_zend_constant_dtor(zend_constant *c) /* {{{ */ 651 647 { 652 free(ZSTR_U(c->name)); 648 free(ZSTR_V(c->name)); 649 } 650 /* }}} */ 651 void xc_free_zend_constant(zend_constant *c) /* {{{ */ 652 { 653 if (!(c->flags & CONST_PERSISTENT)) { 654 zval_dtor(&c->value); 655 } 656 free(ZSTR_V(c->name)); 653 657 } 654 658 /* }}} */ … … 696 700 #ifdef HAVE_XCACHE_CONSTANT 697 701 h = OG(zend_constants); 698 zend_hash_init_ex(&TG(zend_constants), 20, NULL, h->pDestructor, h->persistent, h->bApplyProtection);702 zend_hash_init_ex(&TG(zend_constants), 20, NULL, (dtor_func_t) xc_free_zend_constant, h->persistent, h->bApplyProtection); 699 703 xc_copy_internal_zend_constants(&TG(zend_constants), &XG(internal_constant_table)); 700 704 {

