Re: [ZEND-ENGINE-CVS] cvs: Zend / zend_alloc.c zend_alloc.h

From: Date: Wed, 21 Aug 2002 07:51:14 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: Zend / zend_alloc.c zend_alloc.h
References: 1 2 3 4 5  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-342@lists.php.net to get a copy of this message
At 10:44 21/08/2002, Thies C. Arntzen wrote:
    the interesting thing about having ecalloc as a macro was,
    that if size and nelms are known at compile-time the compiler
    can perfectly (inline) optimize the needed memset. this was
    pointed out by sascha based on some analysis done by
    "apache"-dean.
    the problem is the integer overflow - a agree, so lets move
    the problem "out of our way" in ZE2, nuke ecalloc and add a
    function like emalloc0() which works exaclty like emalloc but
    also initializes the memory returned to \0.
I sympathize with this (why they decided to create such an annoying interface for calloc() in the first place is beyond me). The only drawback is that we lose consistency with libc, and converting code from malloc() to emalloc() becomes slightly more complicated. Not a big deal, for sure, so I think I'm +1. Zeev

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