Re: [PATCH 1/6] virsysinfo: Define and use auto cleanup func for virSysinfoDef properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On a Thursday in 2021, Michal Privoznik wrote:
What we are using really is heap allocated structure rather than
stack allocated. And for that it's better to use g_autoptr() +
G_DEFINE_AUTOPTR_CLEANUP_FUNC() combo, as Glib documentation for
g_auto() reads:

 This is meant to be used with stack-allocated structures and
 non-pointer types. For the (more commonly used) pointer
 version, see g_autoptr().

This will be even more visible, when virSysinfoDefPtr type is
gone. Stay tuned.

Fixes: cee3a900a0d6a8fc79554db22dc262632fe487a6
Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
src/util/virsysinfo.c | 8 ++++----
src/util/virsysinfo.h | 2 +-
tests/sysinfotest.c   | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)


Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux