Changeset 350

Show
Ignore:
Timestamp:
06/20/08 11:20:20 (4 months ago)
Author:
bart
Message:

Failed to stage the commit properly

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/cache.c

    r332 r350  
    252252        q->create = EAG(req_start); 
    253253        /* set the refcount to 1 */ 
    254         q->value.refcount = 1
     254        RESET_PZVAL_REFCOUNT(&q->value)
    255255        store_zval(&EAG(mem), &q->value TSRMLS_CC); 
    256256        zend_hash_destroy(&EAG(strings)); 
  • eaccelerator/trunk/content.c

    r344 r350  
    157157  memcpy(cache_content, content, sizeof(zval)); 
    158158  zval_copy_ctor(cache_content); 
    159   cache_content->is_ref = 0; 
    160   cache_content->refcount = 1; 
     159  INIT_PZVAL(cache_content); 
    161160  add_assoc_zval(&cache_array, "content", cache_content); 
    162161  eaccelerator_put(key, key_len , &cache_array, ttl, eaccelerator_content_cache_place TSRMLS_CC); 
     
    493492  char* zkey; 
    494493  int   zkey_len; 
     494#ifdef ZEND_ENGINE_2_3 
     495  ALLOCA_FLAG(use_heap) 
     496#endif 
    495497 
    496498  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
     
    501503    RETURN_NULL(); 
    502504  } 
     505#ifdef ZEND_ENGINE_2_3 
     506  zkey = do_alloca(key_len+16, use_heap); 
     507#else 
    503508  zkey = do_alloca(key_len+16); 
     509#endif 
    504510  eaccelerator_rm(key, key_len, eaccelerator_content_cache_place TSRMLS_CC); 
    505511  zkey_len = sizeof("gzip_") + key_len - 1; 
  • eaccelerator/trunk/ea_restore.c

    r348 r350  
    4848#if HARDENING_PATCH_HASH_PROTECT 
    4949extern unsigned int zend_hash_canary; 
    50 #endif 
    51  
    52 #ifdef ZEND_ENGINE_2_3 
    53     #define RESET_PZVAL_REFCOUNT(z) Z_SET_REFCOUNT_P(z, 1) 
    54 #else 
    55     #define RESET_PZVAL_REFCOUNT(z) (z)->refcount = 1; 
    5650#endif 
    5751 
  • eaccelerator/trunk/eaccelerator.h

    r348 r350  
    186186#define EA_SIZE_ALIGN(n) (n) = ((((size_t)(n)-1) & ~(EACCELERATOR_PLATFORM_ALIGNMENT-1)) + EACCELERATOR_PLATFORM_ALIGNMENT) 
    187187 
     188#ifdef ZEND_ENGINE_2_3 
     189    #define RESET_PZVAL_REFCOUNT(z) Z_SET_REFCOUNT_P(z, 1) 
     190#else 
     191    #define RESET_PZVAL_REFCOUNT(z) (z)->refcount = 1; 
     192#endif 
    188193 
    189194#define MAX_DUP_STR_LEN 256 
  • eaccelerator/trunk/session.c

    r286 r350  
    116116        int len; 
    117117        zval ret; 
     118#ifdef ZEND_ENGINE_2_3 
     119    ALLOCA_FLAG(use_heap); 
     120#endif 
    118121 
    119122        len = sizeof("sess_") + strlen(key); 
     123#ifdef ZEND_ENGINE_2_3 
     124        skey = do_alloca(len + 1, use_heap); 
     125#else 
    120126        skey = do_alloca(len + 1); 
     127#endif 
    121128        strcpy(skey, "sess_"); 
    122129        strcat(skey, key); 
     
    132139                *vallen = 0; 
    133140        } 
     141#ifdef ZEND_ENGINE_2_3 
     142    free_alloca(skey, use_heap); 
     143#else 
    134144        free_alloca(skey); 
     145#endif 
    135146        return SUCCESS; 
    136147} 
     
    140151        char *skey; 
    141152        int len; 
     153    int result; 
    142154        time_t ttl = INI_INT("session.gc_maxlifetime"); 
    143155        zval sval; 
     156#ifdef ZEND_ENGINE_2_3 
     157    ALLOCA_FLAG(use_heap); 
     158#endif 
    144159 
    145160        len = sizeof("sess_") + strlen(key); 
     161#ifdef ZEND_ENGINE_2_3 
     162        skey = do_alloca(len + 1, use_heap); 
     163#else 
    146164        skey = do_alloca(len + 1); 
     165#endif 
    147166        strcpy(skey, "sess_"); 
    148167        strcat(skey, key); 
     
    156175        do_session_lock(skey TSRMLS_CC); 
    157176        if (eaccelerator_put(skey, len, &sval, ttl, eaccelerator_sessions_cache_place TSRMLS_CC)) { 
    158                 free_alloca(skey); 
    159                 return SUCCESS; 
     177                result = SUCCESS; 
    160178        } else { 
    161                 free_alloca(skey); 
    162                 return FAILURE; 
    163         } 
     179                result = FAILURE; 
     180        } 
     181 
     182#ifdef ZEND_ENGINE_2_3 
     183    free_alloca(skey, use_heap); 
     184#else 
     185        free_alloca(skey); 
     186#endif 
     187 
     188    return result; 
    164189} 
    165190 
     
    168193        char *skey; 
    169194        int len; 
     195    int result; 
     196#ifdef ZEND_ENGINE_2_3 
     197    ALLOCA_FLAG(use_heap); 
     198#endif 
    170199 
    171200        len = sizeof("sess_") + strlen(key); 
     201#ifdef ZEND_ENGINE_2_3 
     202        skey = do_alloca(len + 1, use_heap); 
     203#else 
    172204        skey = do_alloca(len + 1); 
     205#endif 
    173206        strcpy(skey, "sess_"); 
    174207        strcat(skey, key); 
    175208        if (eaccelerator_rm(skey, len, eaccelerator_sessions_cache_place TSRMLS_CC)) { 
    176                 free_alloca(skey); 
    177                 return SUCCESS; 
     209                result = SUCCESS; 
    178210        } else { 
    179                 free_alloca(skey); 
    180                 return FAILURE; 
    181         } 
     211                result = FAILURE; 
     212        } 
     213 
     214#ifdef ZEND_ENGINE_2_3 
     215    free_alloca(skey, use_heap); 
     216#else 
     217        free_alloca(skey); 
     218#endif 
     219 
     220    return result; 
    182221} 
    183222