Changeset 345


Ignore:
Timestamp:
2007-02-04T09:15:00+01:00 (8 years ago)
Author:
moo
Message:

copy function/class table correctly by using add_ref

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils.c

    r344 r345  
    530530/* }}} */ 
    531531#endif 
     532 
     533void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce)) 
     534{ 
     535#ifdef ZEND_ENGINE_2 
     536    (*ce)->refcount++; 
     537#else 
     538    (*ce->refcount)++; 
     539#endif 
     540} 
     541 
    532542xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */ 
    533543{ 
     
    572582    h = OG(function_table); 
    573583    zend_hash_init_ex(&TG(function_table), 128, NULL, h->pDestructor, h->persistent, h->bApplyProtection); 
    574     zend_hash_copy(&TG(function_table), &XG(internal_function_table), NULL, (void *) &tmp_func, sizeof(tmp_func)); 
     584    zend_hash_copy(&TG(function_table), &XG(internal_function_table), (copy_ctor_func_t) function_add_ref, (void *) &tmp_func, sizeof(tmp_func)); 
    575585    TG(internal_class_tail) = TG(function_table).pListTail; 
    576586 
    577587    h = OG(class_table); 
    578588    zend_hash_init_ex(&TG(class_table),     16, NULL, h->pDestructor, h->persistent, h->bApplyProtection); 
    579     zend_hash_copy(&TG(class_table), &XG(internal_class_table), NULL, (void *) &tmp_cest, sizeof(tmp_cest)); 
     589    zend_hash_copy(&TG(class_table), &XG(internal_class_table), (copy_ctor_func_t) xc_zend_class_add_ref, (void *) &tmp_cest, sizeof(tmp_cest)); 
    580590    TG(internal_class_tail) = TG(class_table).pListTail; 
    581591 
  • trunk/utils.h

    r344 r345  
    7575} xc_sandbox_t; 
    7676 
     77void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce)); 
    7778xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC); 
    7879void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC); 
  • trunk/xcache.c

    r344 r345  
    16101610 
    16111611        zend_hash_init_ex(&XG(internal_function_table), 100, NULL, NULL, 1, 0); 
    1612         zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &tmp_func, sizeof(tmp_func)); 
     1612        zend_hash_copy(&XG(internal_function_table), CG(function_table), (copy_ctor_func_t) function_add_ref, &tmp_func, sizeof(tmp_func)); 
    16131613 
    16141614        zend_hash_init_ex(&XG(internal_class_table), 10, NULL, NULL, 1, 0); 
    1615         zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &tmp_cest, sizeof(tmp_cest)); 
     1615        zend_hash_copy(&XG(internal_class_table), CG(class_table), (copy_ctor_func_t) xc_zend_class_add_ref, &tmp_cest, sizeof(tmp_cest)); 
    16161616    } 
    16171617    if (xc_php_hcache.size && !XG(php_holds)) { 
Note: See TracChangeset for help on using the changeset viewer.