From: Anatol Belski Date: Sat, 20 Jun 2015 07:18:00 +0000 (+0200) Subject: Fix bug #69838 OPCACHE Warning Internal error: wrong size calculation X-Git-Tag: php-7.0.0alpha2~2^2~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f88aad418e4e6fcc91d048446f0892a3ee5b065f;p=php Fix bug #69838 OPCACHE Warning Internal error: wrong size calculation This chunk is pre calculated with aligned size, so should it use it at run time. --- diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 09eebe0d02..af8936f104 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -94,7 +94,7 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement } ht->nTableMask = -hash_size; HT_SET_DATA_ADDR(ht, ZCG(mem)); - ZCG(mem) = (void*)((char*)ZCG(mem) + (hash_size * sizeof(uint32_t)) + (ht->nNumUsed * sizeof(Bucket))); + ZCG(mem) = (void*)((char*)ZCG(mem) + ZEND_ALIGNED_SIZE((hash_size * sizeof(uint32_t)) + (ht->nNumUsed * sizeof(Bucket)))); HT_HASH_RESET(ht); memcpy(ht->arData, old_buckets, ht->nNumUsed * sizeof(Bucket)); efree(old_data);