Re: [PATCH] Zend/zend_alloc.c

From: Date: Wed, 29 Aug 2001 12:14:54 +0000
Subject: Re: [PATCH] Zend/zend_alloc.c
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-64590@lists.php.net to get a copy of this message
At 14:57 29-08-01, Walter Franzini wrote:
From the extension (the user of kernel services) pov I must disagree. But obviusly I'missing something :-)
I don't see why there's a difference. There may be a point in giving extension developers an _ex way to try and allocate memory, and fail gracefully (return NULL) in case of failure. We already have this support in realloc(), we can add it to emalloc() if it's necessary. Do you have a case where you want to try and allocate a chunk of memory, and do something special in case it fails (e.g., allocate a smaller block)? If so, we can try to come up with a solution. My main point is that there's a very strong motivation to take away the responsibility of what happens in case of a memory failure away from the API user, and take care of it in a centralized way in the memory manager. It's safer (no possibility of memory allocation failures causing crashes) and it avoids redundant coding. If this behavior is unsuitable in certain cases, we should address these cases, rather than cut this safety net to pieces. Zeev

Thread (18 messages)

« previous php.dev (#64590) next »