On 4/1/14 1:36 PM, Ondrej Oprala wrote:

> That's possible. It might also have been an attempt at further optimization
> - just calling malloc if pointer == NULL, instead going through an
> additional realloc call.
> 
> Either way, I find both of these code snippets very redundant.
Sure, they probably are.  There are other reasons to use xfree (unwind-
protects from back in the days when free's return value varied) and a
desire to instrument malloc, but they probably are somewhat redundant.
The question is what's to be gained by this kind of micro-optimization.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to