Changeset 9e42d11 in git


Ignore:
Timestamp:
2012-03-22T17:29:49Z (8 years ago)
Author:
Xuefer <xuefer@…>
Branches:
3.0, 3.1, 3.2, master, trunk
Children:
ade1c47
Parents:
5daf260
Message:

PHP_5_4: HashTable? bucket changes

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@823 c26eb9a1-5813-0410-bd6c-c2e55f420ca7

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • processor/hashtable.m4

    r5daf260 r9e42d11  
    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;
  • xcache.h

    r5daf260 r9e42d11  
    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.