On 02.02.2024 01:39, Andrew Cooper wrote: > Wherever possible, it is a good idea to NULL out the visible reference to an > object prior to freeing it. The FREE*() macros already collect together both > parts, making it easy to adjust. > > This has a marginal code generation improvement, as some of the calls to the > free() function can be tailcall optimised. > > No functional change. > > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
Acked-by: Jan Beulich <jbeul...@suse.com> However, ... > --- a/xen/include/xen/mm.h > +++ b/xen/include/xen/mm.h > @@ -92,8 +92,9 @@ bool scrub_free_pages(void); > > /* Free an allocation, and zero the pointer to it. */ > #define FREE_XENHEAP_PAGES(p, o) do { \ > - free_xenheap_pages(p, o); \ > + void *_ptr_ = (p); \ ... why a trailing _and_ a leading underscore? Sooner or later we'll need to get rid of the leading ones anyway aiui (for Misra), here and elsewhere. With it omitted right away (also below): Reviewed-by: Jan Beulich <jbeul...@suse.com> Jan