Changeset 627 for branches/1.3/xcache.c


Ignore:
Timestamp:
2009-07-05T11:24:38+02:00 (5 years ago)
Author:
moo
Message:

merged r585:592 from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/xcache.c

    r626 r627  
    15941594} 
    15951595/* }}} */ 
     1596static void xc_copy_zend_constant(zend_constant *c) /* {{{ */ 
     1597{ 
     1598    c->name = zend_strndup(c->name, c->name_len - 1); 
     1599    if (!(c->flags & CONST_PERSISTENT)) { 
     1600        zval_copy_ctor(&c->value); 
     1601    } 
     1602} 
     1603/* }}} */ 
    15961604static void xc_request_init(TSRMLS_D) /* {{{ */ 
    15971605{ 
     
    15991607 
    16001608    if (!XG(internal_table_copied)) { 
     1609#ifdef HAVE_XCACHE_CONSTANT 
     1610        zend_constant tmp_const; 
     1611#endif 
    16011612        zend_function tmp_func; 
    16021613        xc_cest_t tmp_cest; 
    16031614 
     1615#ifdef HAVE_XCACHE_CONSTANT 
     1616        zend_hash_destroy(&XG(internal_constant_table)); 
     1617#endif 
    16041618        zend_hash_destroy(&XG(internal_function_table)); 
    16051619        zend_hash_destroy(&XG(internal_class_table)); 
    16061620 
     1621#ifdef HAVE_XCACHE_CONSTANT 
     1622        zend_hash_init_ex(&XG(internal_constant_table), 20,  NULL, NULL, 1, 0); 
     1623#endif 
    16071624        zend_hash_init_ex(&XG(internal_function_table), 100, NULL, NULL, 1, 0); 
    16081625        zend_hash_init_ex(&XG(internal_class_table),    10,  NULL, NULL, 1, 0); 
    16091626 
     1627#ifdef HAVE_XCACHE_CONSTANT 
     1628        zend_hash_copy(&XG(internal_constant_table), EG(zend_constants), (copy_ctor_func_t) xc_copy_zend_constant, &tmp_const, sizeof(tmp_const)); 
     1629#endif 
    16101630        zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &tmp_func, sizeof(tmp_func)); 
    16111631        zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &tmp_cest, sizeof(tmp_cest)); 
     
    16661686    memset(xcache_globals, 0, sizeof(zend_xcache_globals)); 
    16671687 
     1688#ifdef HAVE_XCACHE_CONSTANT 
     1689    zend_hash_init_ex(&xcache_globals->internal_constant_table, 1, NULL, NULL, 1, 0); 
     1690#endif 
    16681691    zend_hash_init_ex(&xcache_globals->internal_function_table, 1, NULL, NULL, 1, 0); 
    16691692    zend_hash_init_ex(&xcache_globals->internal_class_table,    1, NULL, NULL, 1, 0); 
     
    16971720 
    16981721    if (xcache_globals->internal_table_copied) { 
     1722#ifdef HAVE_XCACHE_CONSTANT 
     1723        zend_hash_destroy(&xcache_globals->internal_constant_table); 
     1724#endif 
    16991725        zend_hash_destroy(&xcache_globals->internal_function_table); 
    17001726        zend_hash_destroy(&xcache_globals->internal_class_table); 
Note: See TracChangeset for help on using the changeset viewer.