NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: misc/49272: Patching with Coccinelle?: Deletion of unnecessary checks before specific function calls
> OK, so you want to change
>
> if (x)
> free(x);
>
> to just
>
> free(x);
>
> and similarly for some functions other than free(), based on the
> idea that free() itself checks the pointer.
Yes. - This is my general idea here.
> It would have been nice if you had actually said that, instead of making
> us read several web pages.
I try to offer a general solution for such a software development detail.
> Performing the test in the caller saves the function call overhead,
> and has no down side at all that I can see.
I find that the desire for such overhead avoidance is inappropriate at the
source code places which I could immediately show with the help of automatically
generated patches.
I prefer to reduce unwanted run time consequences from unneeded safety checks.
Regards,
Markus
Home |
Main Index |
Thread Index |
Old Index