com php-src: Try to control ZEND_MM_ALIGNED_SIZE type : Zend/zend_alloc.h
| From: | Nikita Popov | Date: | Wed, 12 Jun 2019 11:17:25 +0000 |
| Subject: | com php-src: Try to control ZEND_MM_ALIGNED_SIZE type : Zend/zend_alloc.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106715@lists.php.net to get a copy of this message | ||
Commit: 93c728b77cfb47f5cfdd1863f8982ea59d344205
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 12 Jun 2019 13:06:48 +0200
Parents: be36d922943b11ebfbb43112de1c48bef9e2d68a
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=93c728b77cfb47f5cfdd1863f8982ea59d344205
Log:
Try to control ZEND_MM_ALIGNED_SIZE type
Changed paths:
M Zend/zend_alloc.h
Diff:
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index 075aac6..c5838f2 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -27,21 +27,21 @@
#include "zend.h"
#ifndef ZEND_MM_ALIGNMENT
-# define ZEND_MM_ALIGNMENT Z_L(8)
+# define ZEND_MM_ALIGNMENT ((size_t) 8)
# define ZEND_MM_ALIGNMENT_LOG2 Z_L(3)
#elif ZEND_MM_ALIGNMENT < 4
# undef ZEND_MM_ALIGNMENT
# undef ZEND_MM_ALIGNMENT_LOG2
-# define ZEND_MM_ALIGNMENT Z_L(4)
+# define ZEND_MM_ALIGNMENT ((size_t) 4)
# define ZEND_MM_ALIGNMENT_LOG2 Z_L(2)
#endif
-#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT - Z_L(1))
+#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT - 1)
-#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - Z_L(1)) &
ZEND_MM_ALIGNMENT_MASK)
+#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
#define ZEND_MM_ALIGNED_SIZE_EX(size, alignment) \
- (((size) + ((alignment) - Z_L(1))) & ~((alignment) - Z_L(1)))
+ (((size) + ((alignment) - 1)) & ~((alignment) - 1))
typedef struct _zend_leak_info {
void *addr;