I disagree with this patch. The scenario of not being able to allocate memory is a
fatal error, and the only appropriate response for php is to exit. If you need other
behavior use pemalloc( which calls malloc if set persistant ).
-Jason
----- Original Message -----
From: "Walter Franzini" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 8:50 AM
Subject: [PHP-DEV] [PATCH] Zend/zend_alloc.c
>
> Hi,
>
> is ok to send to this list patch for Zend?
>
> I think _emalloc should not exit if unable to allocate enough memory,
> malloc behave differently :-)
>
> the patch below fix also a small problem with the format string.
>
>
> --- php-4.0.6.ORIG/Zend/zend_alloc.c Tue Jun 19 20:04:53 2001
> +++ php-4.0.6/Zend/zend_alloc.c Tue Jul 31 10:32:39 2001
> @@ -158,12 +158,11 @@
> HANDLE_BLOCK_INTERRUPTIONS();
>
> if (!p) {
> - fprintf(stderr,"FATAL: emalloc(): Unable to allocate %ld bytes\n", (long) size);
> + fprintf(stderr,"FATAL: emalloc(): Unable to allocate %lu bytes\n", (long
>unsigned) size);
> #if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID)
> kill(getpid(), SIGSEGV);
> -#else
> - exit(1);
> #endif
> +
> HANDLE_UNBLOCK_INTERRUPTIONS();
> return (void *)p;
> }
>
>
> Ciao
> --
> Walter Franzini, e-mail: [EMAIL PROTECTED]
> SysNet, Via Digione 8, 27100 Pavia - Italy
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]