[CRIU] [PATCH 1/2] Get rid of xfree()

Cyrill Gorcunov gorcunov at gmail.com
Tue Oct 20 00:36:19 PDT 2015


On Tue, Oct 20, 2015 at 10:24:00AM +0300, Pavel Emelyanov wrote:
> On 10/20/2015 03:27 AM, Kir Kolyshkin wrote:
> > Contrary to a popular opinion, there is no need to check
> > an argument for being non-NULL before calling free().
> > 
> >>From free(3) man page:
> > 
> >> If ptr is NULL, no operation is performed.
> > 
> > Let's remove xfree() macro and replace all calls to free().
> 
> I'd like to keep xfree()-s in the code. Partially to be
> symmetrical to xmalloc-s, partially to make it possible 
> to quickly spot the places where we free the memory.

True. Except that we can drop off @if statement in
xfree macro itself ;)


More information about the CRIU mailing list