n_free() from trurlib in poldek sources

Tomasz Wittner Tomasz.Wittner at xl.wp.pl
Thu Nov 11 16:21:36 CET 2004


In poldek-0.18.7/trurlib/nmalloc.c we can see:
[...]
void n_free(void *ptr)
{
    if (ptr)
        free(ptr);
}
[...]
IMvHO this code doesn't make sense - wastes CPU cycles only. Quoitting from 
free(3) manpage:
"If ptr is NULL, no operation is performed."

Please, review and test attached patch. If it's correct, please commit it on 
behalf of me.

-- 
Tomasz Wittner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poldek-kill_n_free.patch
Type: text/x-diff
Size: 2815 bytes
Desc: not available
Url : /mailman/pipermail/pld-devel-en/attachments/20041111/3181be66/poldek-kill_n_free-0002.bin


More information about the pld-devel-en mailing list