Skip to content

Commit 526ee4f

Browse files
committed
Adjust ZEND_MM_ALIGNED_OFFSET argument name
Since it is clear that it is a pointer now, we may use ZEND_MM_ALIGNED_BASE for the builtin implementation.
1 parent eb4b0d7 commit 526ee4f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Zend/zend_alloc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ typedef uint32_t zend_mm_page_info; /* 4-byte integer */
176176
typedef zend_ulong zend_mm_bitset; /* 4-byte or 8-byte integer */
177177

178178
#ifdef PHP_HAVE_BUILTIN_ALIGN_DOWN
179-
# define ZEND_MM_ALIGNED_OFFSET(size, alignment) \
180-
(((size_t)(size)) - (size_t)__builtin_align_down((size), (alignment)))
181179
# define ZEND_MM_ALIGNED_BASE(ptr, alignment) \
182180
__builtin_align_down((ptr), (alignment))
181+
# define ZEND_MM_ALIGNED_OFFSET(ptr, alignment) \
182+
(((size_t)(ptr)) - (size_t)ZEND_MM_ALIGNED_BASE(ptr, alignment))
183183
#else
184-
# define ZEND_MM_ALIGNED_OFFSET(size, alignment) \
185-
(((size_t)(size)) & ((alignment) - 1))
186184
# define ZEND_MM_ALIGNED_BASE(ptr, alignment) \
187185
(((uintptr_t)(ptr)) & ~((alignment) - 1))
186+
# define ZEND_MM_ALIGNED_OFFSET(ptr, alignment) \
187+
(((size_t)(ptr)) & ((alignment) - 1))
188188
#endif
189189

190190
#ifdef PHP_HAVE_BUILTIN_ALIGN_UP

0 commit comments

Comments
 (0)