]> granicus.if.org Git - php/commitdiff
Fix bug #69838 OPCACHE Warning Internal error: wrong size calculation
authorAnatol Belski <ab@php.net>
Sat, 20 Jun 2015 07:18:00 +0000 (09:18 +0200)
committerAnatol Belski <ab@php.net>
Sat, 20 Jun 2015 07:35:01 +0000 (09:35 +0200)
This chunk is pre calculated with aligned size, so should it use it
at run time.

ext/opcache/zend_persist.c

index 09eebe0d02523252ec8c30780893e0a24f47905f..af8936f104040a8d041dd152a0f1a16018162612 100644 (file)
@@ -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);