Changeset 1129 for trunk


Ignore:
Timestamp:
2012-08-09T05:14:56+02:00 (2 years ago)
Author:
moo
Message:

refactor: code clean up

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cacher.c

    r1127 r1129  
    33133313 
    33143314    if (strcmp(sapi_module.name, "cli") == 0) { 
    3315         if ((env = getenv("XCACHE_TEST")) != NULL) { 
    3316             xc_test = atoi(env); 
    3317         } 
    33183315        if (!xc_test) { 
    33193316            /* disable cache for cli except for testing */ 
  • trunk/xcache.c

    r1113 r1129  
    690690    } 
    691691 
     692    if (strcmp(sapi_module.name, "cli") == 0) { 
     693        if ((env = getenv("XCACHE_TEST")) != NULL) { 
     694            xc_test = atoi(env); 
     695        } 
     696    } 
     697 
    692698    xc_init_constant(module_number TSRMLS_CC); 
    693699    xc_shm_init_modules(); 
  • trunk/xcache/xc_malloc.c

    r982 r1129  
    2525    xc_shmsize_t       size; 
    2626    xc_shmsize_t       memoffset; 
    27 #ifdef HAVE_XCACHE_TEST 
    2827    HashTable blocks; 
    29 #endif 
    3028}; 
    3129/* }}} */ 
     
    3533static void *xc_add_to_blocks(xc_mem_t *mem, void *p, size_t size) /* {{{ */ 
    3634{ 
    37 #ifdef HAVE_XCACHE_TEST 
    3835    if (p) { 
    3936        zend_hash_add(&mem->shm->blocks, (void *) &p, sizeof(p), (void *) &size, sizeof(size), NULL); 
    4037    } 
    41 #endif 
    4238    return p; 
    4339} 
     
    4541static void xc_del_from_blocks(xc_mem_t *mem, void *p) /* {{{ */ 
    4642{ 
    47 #ifdef HAVE_XCACHE_TEST 
    4843    zend_hash_del(&mem->shm->blocks, (void *) &p, sizeof(p)); 
    49 #endif 
    5044} 
    5145/* }}} */ 
     
    148142static XC_SHM_IS_READWRITE(xc_malloc_is_readwrite) /* {{{ */ 
    149143{ 
    150 #ifdef HAVE_XCACHE_TEST 
    151144    HashPosition pos; 
    152145    size_t *psize; 
     
    161154        zend_hash_move_forward_ex(&shm->blocks, &pos); 
    162155    } 
    163 #endif 
    164156 
    165157    return 0; 
     
    184176static XC_SHM_DESTROY(xc_malloc_destroy) /* {{{ */ 
    185177{ 
    186 #ifdef HAVE_XCACHE_TEST 
    187178    zend_hash_destroy(&shm->blocks); 
    188 #endif 
    189179    free(shm); 
    190180    return; 
     
    197187    shm->size = size; 
    198188 
    199 #ifdef HAVE_XCACHE_TEST 
    200189    zend_hash_init(&shm->blocks, 64, NULL, NULL, 1); 
    201 #endif 
    202190    return shm; 
    203191err: 
Note: See TracChangeset for help on using the changeset viewer.