From ade1c4764b27448b32b7b625d4221cf65430f262 Mon Sep 17 00:00:00 2001 From: Xuefer Date: Thu, 22 Mar 2012 17:53:11 +0000 Subject: [PATCH] PHP_5_4: empty hashtable was optimized git-svn-id: svn://svn.lighttpd.net/xcache/trunk@824 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- processor/hashtable.m4 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/processor/hashtable.m4 b/processor/hashtable.m4 index 50adf55..1023db3 100644 --- a/processor/hashtable.m4 +++ b/processor/hashtable.m4 @@ -87,10 +87,12 @@ define(`DEF_HASH_TABLE_FUNC', ` DISPATCH(ulong, nNextFreeElement) IFCOPY(`dst->pInternalPointer = NULL; /* Used for element traversal */') DONE(pInternalPointer) IFCOPY(`dst->pListHead = NULL;') DONE(pListHead) +#ifdef ZEND_ENGINE_2_4 + if (src->nTableMask) { +#endif CALLOC(dst->arBuckets, Bucket*, src->nTableSize) DONE(arBuckets) DISABLECHECK(` - for (b = src->pListHead; b != NULL; b = b->pListNext) { ifelse($4, `', `', ` pushdef(`BUCKET', `b') @@ -154,6 +156,12 @@ define(`DEF_HASH_TABLE_FUNC', ` prev = pnew; } ') +#ifdef ZEND_ENGINE_2_4 + } + else { /* if (src->nTableMask) */ + DONE(arBuckets) + } +#endif IFCOPY(`dst->pListTail = pnew;') DONE(pListTail) IFCOPY(`dst->pDestructor = src->pDestructor;') DONE(pDestructor) DISPATCH(zend_bool, persistent)