Changeset 269 for trunk/utils.c


Ignore:
Timestamp:
2006-10-29T09:02:58+01:00 (8 years ago)
Author:
moo
Message:

do not destruct shallow copied tmp_auto_globals. also improve copying of other hash tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils.c

    r268 r269  
    536536xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */ 
    537537{ 
     538    HashTable *h; 
    538539    if (sandbox) { 
    539540        memset(sandbox, 0, sizeof(sandbox[0])); 
     
    567568    zend_hash_init_ex(TG(included_files), 5, NULL, NULL, 0, 1); 
    568569#ifdef HAVE_XCACHE_CONSTANT 
    569     zend_hash_init_ex(&TG(zend_constants), 20, NULL, OG(zend_constants)->pDestructor, 1, 0); 
    570 #endif 
    571     zend_hash_init_ex(&TG(function_table), 128, NULL, OG(function_table)->pDestructor, 0, 0); 
    572     zend_hash_init_ex(&TG(class_table), 16, NULL, OG(class_table)->pDestructor, 0, 0); 
    573 #ifdef ZEND_ENGINE_2_1 
    574     zend_hash_init_ex(&TG(auto_globals), 8, NULL, OG(auto_globals)->pDestructor, 0, 0); 
     570    h = OG(zend_constants); 
     571    zend_hash_init_ex(&TG(zend_constants),  20, NULL, h->pDestructor, h->persistent, h->bApplyProtection); 
     572#endif 
     573    zend_hash_init_ex(&TG(function_table), 128, NULL, h->pDestructor, h->persistent, h->bApplyProtection); 
     574    zend_hash_init_ex(&TG(class_table),     16, NULL, h->pDestructor, h->persistent, h->bApplyProtection); 
     575#ifdef ZEND_ENGINE_2_1 
     576    /* shallow copy, don't destruct */ 
     577    zend_hash_init_ex(&TG(auto_globals),     8, NULL,           NULL, h->persistent, h->bApplyProtection); 
    575578    { 
    576579        zend_auto_global tmp_autoglobal; 
     
    676679        TG(function_table).pDestructor = NULL; 
    677680        TG(class_table).pDestructor = NULL; 
    678 #ifdef ZEND_ENGINE_2_1 
    679         TG(auto_globals).pDestructor = NULL; 
    680 #endif 
    681681    } 
    682682 
Note: See TracChangeset for help on using the changeset viewer.