|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH for-4.6 2/8] tools/libxl: Assert that libxl__ao_inprogress_gc() is not called with NULL
Andrew Cooper writes ("[PATCH for-4.6 2/8] tools/libxl: Assert that
libxl__ao_inprogress_gc() is not called with NULL"):
> libxl__ao_inprogress_gc() is hidden behind various macros used to
> construct local variables. Assert() that NULL is not passed, to make
> such an error very obvious, rather than a plain segfault at 0.
I'm not in general a huge fan of this approach. It can be unclear
where it ends: should every function that requires non-null arguments
assert all those arguments ?
But (a) libxl__ao_inprogress_gc is a special case because one of its
purposes is to check the state of the ao being dealt with and (b) the
assert may help prevent an optimiser (perhaps a whole program
optimiser) from doing something insane if it notices that a particular
path always passes ao==0.
So:
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |