summaryrefslogtreecommitdiff
path: root/Zend/zend_alloc.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2009-09-03 14:33:11 +0000
committerDmitry Stogov <dmitry@php.net>2009-09-03 14:33:11 +0000
commit4016bfcd719171b128f20196a2a6eda8b3d8dd0e (patch)
tree56a1aacab463827b4dcfdf87241943633db6f890 /Zend/zend_alloc.h
parent853c6de65bbd83000fdb1cf59fb164a3516861cd (diff)
downloadphp-git-4016bfcd719171b128f20196a2a6eda8b3d8dd0e.tar.gz
Fixed bug #46074 (Bus error during running PHP CLI under IRIX 6.5.30)
Diffstat (limited to 'Zend/zend_alloc.h')
-rw-r--r--Zend/zend_alloc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index 4462a80fb6..48049cd650 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -27,6 +27,20 @@
#include "../TSRM/TSRM.h"
#include "zend.h"
+#ifndef ZEND_MM_ALIGNMENT
+# define ZEND_MM_ALIGNMENT 8
+# define ZEND_MM_ALIGNMENT_LOG2 3
+#elif ZEND_MM_ALIGNMENT < 4
+# undef ZEND_MM_ALIGNMENT
+# undef ZEND_MM_ALIGNMENT_LOG2
+# define ZEND_MM_ALIGNMENT 4
+# define ZEND_MM_ALIGNMENT_LOG2 2
+#endif
+
+#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
+
+#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
+
typedef struct _zend_leak_info {
void *addr;
size_t size;