Changeset 131 in svn


Ignore:
Timestamp:
2006-09-03T09:37:05+02:00 (9 years ago)
Author:
Xuefer
Message:

move open_files out of sandbox, it's not needed

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils.c

    r121 r131  
    371371
    372372    memcpy(&OG(included_files), &EG(included_files), sizeof(EG(included_files)));
    373     memcpy(&OG(open_files), &CG(open_files), sizeof(CG(open_files)));
    374373
    375374#ifdef HAVE_XCACHE_CONSTANT
     
    388387
    389388    TG(included_files) = &EG(included_files);
    390     TG(open_files)     = &CG(open_files);
    391 
    392     zend_llist_init(TG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0);
     389
    393390    zend_hash_init_ex(TG(included_files), 5, NULL, NULL, 0, 1);
    394391#ifdef HAVE_XCACHE_CONSTANT
     
    440437    i = 1;
    441438    zend_hash_add(&OG(included_files), sandbox->filename, strlen(sandbox->filename) + 1, (void *)&i, sizeof(int), NULL);
    442     for (handle = zend_llist_get_first_ex(TG(open_files), &lpos);
    443             handle;
    444             handle = zend_llist_get_next_ex(TG(open_files), &lpos)) {
    445         zend_llist_add_element(&OG(open_files), handle);
    446     }
    447439}
    448440/* }}} */
     
    466458        TG(function_table).pDestructor = NULL;
    467459        TG(class_table).pDestructor = NULL;
    468         TG(open_files)->dtor = NULL;
    469460    }
    470461
     
    476467    zend_hash_destroy(&TG(class_table));
    477468    zend_hash_destroy(TG(included_files));
    478     zend_llist_destroy(TG(open_files));
    479469
    480470    /* restore orig here, as EG/CG holded tmp before */
    481471    memcpy(&EG(included_files), &OG(included_files), sizeof(EG(included_files)));
    482     memcpy(&CG(open_files),     &OG(open_files),     sizeof(CG(open_files)));
    483472
    484473    if (sandbox->alloc) {
  • trunk/utils.h

    r103 r131  
    3838
    3939    HashTable orig_included_files;
    40     zend_llist orig_open_files;
    4140    HashTable *tmp_included_files;
    42     zend_llist *tmp_open_files;
    4341
    4442#ifdef HAVE_XCACHE_CONSTANT
  • trunk/xcache.c

    r130 r131  
    559559    i = 1;
    560560    zend_hash_add(&EG(included_files), xce->name.str.val, xce->name.str.len+1, (void *)&i, sizeof(int), NULL);
    561     zend_llist_add_element(&CG(open_files), h);
     561    if (h) {
     562        zend_llist_add_element(&CG(open_files), h);
     563    }
    562564
    563565#ifndef ZEND_ENGINE_2
     
    939941
    940942    if (xc_test && stored_xce) {
    941         /* no install, keep open_files too for h */
     943        /* free it, no install. restore now */
    942944        xc_sandbox_free(&sandbox, 0 TSRMLS_CC);
    943         sandbox.tmp_open_files->dtor = NULL;
    944945    }
    945946    else {
     
    956957        destroy_op_array(op_array TSRMLS_CC);
    957958        efree(op_array);
     959        h = NULL;
    958960        goto restore;
    959961    }
Note: See TracChangeset for help on using the changeset viewer.