From 0742edb3969a92a710dc940ddb1d04be35e3cfe6 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 1 Dec 2006 15:33:06 +0000 Subject: [PATCH] Fixed bug #39702 (php crashes in the allocator on linux-m68k) --- NEWS | 1 + Zend/zend_alloc.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index b04045831be..ea37bf043ce 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 1166008099e..cb14c3788b4 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);