summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--Zend/zend_alloc.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index b04045831b..ea37bf043c 100644
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,7 @@ PHP NEWS
php_filter.h).
- Fixed wrong signature initialization in imagepng (Takeshi Abe)
- Added optimization for imageline with horizontal and vertial lines (Pierre)
+- Fixed bug #39702 (php crashes in the allocator on linux-m68k). (Dmitry)
- Fixed bug #39673 (file_get_contents causes bus error on certain offsets).
(Tony)
- Fixed bug #39663 (Memory leak in pg_get_notify() and a possible memory
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 1166008099..cb14c3788b 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -373,6 +373,11 @@ struct _zend_mm_heap {
#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
+# define ZEND_MM_ALIGNMENT 4
+# define ZEND_MM_ALIGNMENT_LOG2 2
#endif
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
@@ -587,6 +592,8 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers,
#if 0
int i;
+ printf("ZEND_MM_ALIGNMENT=%d\n", ZEND_MM_ALIGNMENT);
+ printf("ZEND_MM_ALIGNMENT_LOG2=%d\n", ZEND_MM_ALIGNMENT_LOG2);
printf("ZEND_MM_MIN_SIZE=%d\n", ZEND_MM_MIN_SIZE);
printf("ZEND_MM_MAX_SMALL_SIZE=%d\n", ZEND_MM_MAX_SMALL_SIZE);
printf("ZEND_MM_ALIGNED_HEADER_SIZE=%d\n", ZEND_MM_ALIGNED_HEADER_SIZE);