Skip to content

Commit 93c728b

Browse files
committed
Try to control ZEND_MM_ALIGNED_SIZE type
1 parent be36d92 commit 93c728b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Zend/zend_alloc.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@
2727
#include "zend.h"
2828

2929
#ifndef ZEND_MM_ALIGNMENT
30-
# define ZEND_MM_ALIGNMENT Z_L(8)
30+
# define ZEND_MM_ALIGNMENT ((size_t) 8)
3131
# define ZEND_MM_ALIGNMENT_LOG2 Z_L(3)
3232
#elif ZEND_MM_ALIGNMENT < 4
3333
# undef ZEND_MM_ALIGNMENT
3434
# undef ZEND_MM_ALIGNMENT_LOG2
35-
# define ZEND_MM_ALIGNMENT Z_L(4)
35+
# define ZEND_MM_ALIGNMENT ((size_t) 4)
3636
# define ZEND_MM_ALIGNMENT_LOG2 Z_L(2)
3737
#endif
3838

39-
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT - Z_L(1))
39+
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT - 1)
4040

41-
#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - Z_L(1)) & ZEND_MM_ALIGNMENT_MASK)
41+
#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
4242

4343
#define ZEND_MM_ALIGNED_SIZE_EX(size, alignment) \
44-
(((size) + ((alignment) - Z_L(1))) & ~((alignment) - Z_L(1)))
44+
(((size) + ((alignment) - 1)) & ~((alignment) - 1))
4545

4646
typedef struct _zend_leak_info {
4747
void *addr;

0 commit comments

Comments
 (0)