]> xenbits.xensource.com Git - xen.git/commit
xen: Swap order of actions in the FREE*() macros
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 2 Feb 2024 00:39:42 +0000 (00:39 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 Mar 2024 16:22:44 +0000 (16:22 +0000)
commit0cfea4bc8f6e5a54d2c001089607dd7bf3ceec19
tree6ad1e0a34c0b7f94ebc0b0a1c1e163e77aa69777
parentac20165f11c1935329ae73eda6b9f90a0b894a67
xen: Swap order of actions in the FREE*() macros

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.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit c4f427ec879e7c0df6d44d02561e8bee838a293e)
xen/include/xen/mm.h
xen/include/xen/xmalloc.h