> You're right the compiler knows the size in the caller function but not
> in ecalloc of cause. Shouldn't then ecalloc be a compiler define?
>
> #define ecalloc(num, size) \
>    memset( emalloc(num*size), 0, num*size)

    It was like that until Aug 18th.  A commit back then turned
    the fast macro back into a slow function again and added a
    division.  With that kind of setup, the compiler has no
    chance to reduce and optimize the target code.

    By using emalloc+memset, we get compile-time reduction (no
    multiplication at run-time) and inlining for free.

    - Sascha


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to