Re: Patch for PHP 4.0.6 memory limit problem posted

From: Date: Mon, 02 Jul 2001 03:52:31 +0000
Subject: Re: Patch for PHP 4.0.6 memory limit problem posted
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-55778@lists.php.net to get a copy of this message
At 10:49 PM 7/1/2001 +0300, Rouvas Stathis wrote:
Andi Gutmans wrote: At 10:17 PM 7/1/2001 +0300, Rouvas Stathis wrote:
It is indeed strange, since in the sources I have (downloaded about a week ago), I already have the exact source that the patch presents (without the lines prefixed with +). I'm looking at $PHPHOME/Zend/zend_alloc.c file. Am I to suppose that there is no need to patch anything?
The official package of PHP 4.0.6 (http://www.php.net/downloads.php) does not have this patch. Are you sure you are looking at the release version? Maybe you are using a snapshot or CVS version? I do not use the CVS version, mainly because I do not know how to handle CVS :-) These are the lines from $PHPHOME/Zend/zend_alloc.c that I have. <lines-from-443-to-454>
443         if (1 || clean_cache) {
444                 zend_mem_header *ptr;
445
446                 for (i=1; i<MAX_CACHED_MEMORY; i++) {
447                         for (j=0; j<AG(cache_count)[i]; j++) {
448                                 ptr = (zend_mem_header *)
AG(cache)[i][j];
449                                 REMOVE_POINTER_FROM_LIST(ptr);
450                                 free(ptr);
451                         }
452                         AG(cache_count)[i] = 0;
453                 }
454         }
</lines-from-443-to-454> What do you think?
This is the official PHP 4.0.6 version. After line 448 insert: #if MEMORY_LIMIT
                               AG(allocated_memory) -= REAL_SIZE(ptr->size);
#endif If you'll take a good look at the diff file the first half is what you're supposed to have and the second half is what it's supposed to change to. You probably missed the second half. Andi

« previous php.general (#55778) next »