Skip to content

Commit 844d6b9

Browse files
committed
Add define when 8byte realingment is needed
1 parent 34a0298 commit 844d6b9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Zend/zend_alloc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#elif ZEND_MM_ALIGNMENT < 4
3333
# define ZEND_MM_ALIGNMENT (size_t)4
3434
# define ZEND_MM_ALIGNMENT_LOG2 (size_t)2
35+
# define ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT 1
3536
#else
3637
# define ZEND_MM_ALIGNMENT (size_t)CONFIG_ZEND_MM_ALIGNMENT
3738
# define ZEND_MM_ALIGNMENT_LOG2 (size_t)CONFIG_ZEND_MM_ALIGNMENT_LOG2

ext/opcache/ZendAccelerator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script
14261426
/* Align to 64-byte boundary */
14271427
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 64);
14281428
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 63L) & ~63L);
1429-
#elif ZEND_MM_ALIGNMENT < 8
1429+
#elif defined(ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT)
14301430
/* Align to 8-byte boundary */
14311431
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 8);
14321432
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 7L) & ~7L);
@@ -2371,7 +2371,7 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
23712371

23722372
zend_shared_alloc_clear_xlat_table();
23732373

2374-
#if ZEND_MM_ALIGNMENT < 8
2374+
#ifdef ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT
23752375
/* Align to 8-byte boundary */
23762376
ZCG(mem) = zend_shared_alloc(size + 8);
23772377
#else
@@ -2385,7 +2385,7 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
23852385
return NULL;
23862386
}
23872387

2388-
#if ZEND_MM_ALIGNMENT < 8
2388+
#ifdef ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT
23892389
/* Align to 8-byte boundary */
23902390
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 7L) & ~7L);
23912391
#endif

0 commit comments

Comments
 (0)