mbox series

[v2,0/2] introduce QEMU_AUTO_VFREE

Message ID 20210628121133.193984-1-vsementsov@virtuozzo.com (mailing list archive)
Headers show
Series introduce QEMU_AUTO_VFREE | expand

Message

Vladimir Sementsov-Ogievskiy June 28, 2021, 12:11 p.m. UTC
Hi all!

There is a good movement to use g_autofree macro, that helps to
automatically call g_free on exit from code block.

We lack similar possibility for qemu_memalign() functions family. Let's
add, it seems rather simple with help of "cleanup" attribute.

v2: rewrite 01 (as first version was just wrong)

Vladimir Sementsov-Ogievskiy (2):
  introduce QEMU_AUTO_VFREE
  block/commit: use QEMU_AUTO_VFREE

 include/qemu/osdep.h | 15 +++++++++++++++
 block/commit.c       | 25 +++++++++----------------
 2 files changed, 24 insertions(+), 16 deletions(-)

Comments

Kevin Wolf June 29, 2021, 3:44 p.m. UTC | #1
Am 28.06.2021 um 14:11 hat Vladimir Sementsov-Ogievskiy geschrieben:
> Hi all!
> 
> There is a good movement to use g_autofree macro, that helps to
> automatically call g_free on exit from code block.
> 
> We lack similar possibility for qemu_memalign() functions family. Let's
> add, it seems rather simple with help of "cleanup" attribute.
> 
> v2: rewrite 01 (as first version was just wrong)

Thanks, applied to the block branch.

Kevin