There's a big difference between an undefined behavior which may result in 
a crash, and an organized shutdown.  The former is dangerous, the latter is 
There are some parts of code that don't rely on this, from the times when 
it wasn't true, but it doesn't cause any problem, so there's no reason to 
change it urgently.


At 09:54 29-08-01, Walter Franzini wrote:
>Stanislav Malyshev <[EMAIL PROTECTED]> writes:
> > JG>> I disagree with this patch. The scenario of not being able to
> > JG>> allocate memory is a fatal error, and the only appropriate
> > JG>> response for php is to exit. If you need other behavior use
> > JG>> pemalloc( which calls malloc if set persistant ).
> >
> > Actually, there's a lot of code in PHP that is based on the assumption
> > that emalloc never fails. If emalloc can return NULLs, all this code
> > should be rewritten. I do not see any point in it and agree with Jason.
>You are right, but this "feature" (emalloc never fails) is
>undocumented and both php and zend are full of code that just check the
>emalloc return value.  You can find some example also in zend_alloc.c.
>Changing emalloc to return NULLs does not modify the program
>behaviour: you (probably) receive a SIGSEGV from the emalloc caller
>and the execution terminate.  I can't see a big difference in this
>case, but if you check for NULL you can fail gracefully.
>Walter Franzini, e-mail: [EMAIL PROTECTED]
>SysNet, Via Digione 8, 27100 Pavia - Italy
>PHP Development Mailing List <>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

Zeev Suraski <[EMAIL PROTECTED]>
CTO &  co-founder, Zend Technologies Ltd.

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to