Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend_alloc.c /tests bug44069.phpt

From: Date: Thu, 14 Feb 2008 14:46:45 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend_alloc.c /tests bug44069.phpt
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6405@lists.php.net to get a copy of this message
You should MFH this fix to PHP_5_2 too. --Jani On Thu, 2008-02-14 at 14:42 +0000, Dmitry Stogov wrote: > dmitry Thu Feb 14 14:42:00 2008 UTC > > Added files: (Branch: PHP_5_3) > /ZendEngine2/tests bug44069.phpt > > Modified files: > /ZendEngine2 zend_alloc.c > Log: > Fixed bug #44069 (Huge memory usage with concatenation using . instead of .=) > > > > http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_alloc.c?r1=1.144.2.3.2.43.2.10&r2=1.144.2.3.2.43.2.11&diff_format=u > Index: ZendEngine2/zend_alloc.c > diff -u ZendEngine2/zend_alloc.c:1.144.2.3.2.43.2.10 > ZendEngine2/zend_alloc.c:1.144.2.3.2.43.2.11 > --- ZendEngine2/zend_alloc.c:1.144.2.3.2.43.2.10 Thu Jan 24 12:21:32 2008 > +++ ZendEngine2/zend_alloc.c Thu Feb 14 14:42:00 2008 > @@ -18,7 +18,7 @@ > +----------------------------------------------------------------------+ > */ > > -/* $Id: zend_alloc.c,v 1.144.2.3.2.43.2.10 2008/01/24 12:21:32 dmitry Exp $ */ > +/* $Id: zend_alloc.c,v 1.144.2.3.2.43.2.11 2008/02/14 14:42:00 dmitry Exp $ */ > > #include "zend.h" > #include "zend_alloc.h" > @@ -1748,6 +1748,7 @@ > size_t remaining_size; > size_t segment_size; > zend_mm_segment *segment; > + int keep_rest = 0; > > if (EXPECTED(ZEND_MM_SMALL_SIZE(true_size))) { > size_t index = ZEND_MM_BUCKET_INDEX(true_size); > @@ -1816,6 +1817,7 @@ > segment must have header "size" and trailer "guard" block */ > segment_size = true_size + ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE; > segment_size = (segment_size + (heap->block_size-1)) & ~(heap->block_size-1); > + keep_rest = 1; > } else { > segment_size = heap->block_size; > } > @@ -1895,7 +1897,11 @@ > ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size); > > /* add the new free block to the free list */ > - zend_mm_add_to_free_list(heap, new_free_block); > + if (EXPECTED(!keep_rest)) { > + zend_mm_add_to_free_list(heap, new_free_block); > + } else { > + zend_mm_add_to_rest_list(heap, new_free_block); > + } > } > > ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 1); > > > http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug44069.phpt?view=markup&rev=1.1 > Index: ZendEngine2/tests/bug44069.phpt > +++ ZendEngine2/tests/bug44069.phpt > -- Patches/Donations: http://pecl.php.net/~jani/

« previous php.zend-engine.cvs (#6405) next »