Changeset 823


Ignore:
Timestamp:
2012-03-22T18:29:49+01:00 (2 years ago)
Author:
moo
Message:

PHP_5_4: HashTable? bucket changes

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/hashtable.m4

    r822 r823  
    104104            IFCALCCOPY(`bucketsize = BUCKET_SIZE(b);') 
    105105            ALLOC(pnew, char, bucketsize, , Bucket) 
    106             IFCOPY(`memcpy(pnew, b, bucketsize);') 
     106            IFCOPY(` 
     107#ifdef ZEND_ENGINE_2_4 
     108            memcpy(pnew, b, BUCKET_HEAD_SIZE(Bucket)); 
     109            pnew->arKey = (const char *) (pnew + 1); 
     110            memcpy(pnew->arKey, b->arKey, BUCKET_KEY_SIZE(b)); 
     111#else 
     112            memcpy(pnew, b, bucketsize); 
     113    #endif 
     114            ') 
    107115            IFCOPY(` 
    108116                n = b->h & src->nTableMask; 
  • trunk/xcache.h

    r822 r823  
    140140#   define BUCKET_HEAD_SIZE(b) XtOffsetOf(Bucket, arKey) 
    141141#endif 
    142 #define BUCKET_SIZE(b) (BUCKET_HEAD_SIZE(b) + BUCKET_KEY_SIZE(b)) 
     142 
     143#ifdef ZEND_ENGINE_2_4 
     144#   define BUCKET_SIZE(b) (sizeof(Bucket) + BUCKET_KEY_SIZE(b)) 
     145#else 
     146#   define BUCKET_SIZE(b) (BUCKET_HEAD_SIZE(b) + BUCKET_KEY_SIZE(b)) 
     147#endif 
    143148 
    144149#ifndef IS_UNICODE 
Note: See TracChangeset for help on using the changeset viewer.