qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] virtiofsd: Changed various allocations to GLib functions
@ 2021-04-20 15:46 Mahmoud Mandour
  2021-04-20 15:46 ` [PATCH v2 1/7] virtiofsd: Changed allocations of fuse_req " Mahmoud Mandour
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Mahmoud Mandour @ 2021-04-20 15:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mahmoud Mandour

Replaced allocations done using malloc(), calloc(), and realloc()
to their equivalent functions in GLib.

Memory that is allocated locally and freed when the function exits
are annotated g_autofree so that the deallocation is automatically
handled. Subsequently, I could remove a bunch of free() calls.

Also, tried to keep the semantics of the code as is, but when the
allocation is a small one, or a crucial one, I replaced the
NULL-checking mechanisms with glib's functions that crash on error.

This is related to a patch that I had submitted as a part of a
previous series. The previous patch had some errors. Also, I thought
that it's better to split the patch into smaller pieces.

Mahmoud Mandour (7):
  virtiofsd: Changed allocations of fuse_req to GLib functions
  virtiofds: Changed allocations of iovec to GLib's functions
  virtiofsd: Changed allocations of fuse_session to GLib's functions
  virtiofsd: Changed allocation of lo_map_elems to GLib's functions
  virtiofsd: Changed allocations of fv_VuDev & its internals to GLib
    functions
  virtiofsd/passthrough_ll.c: Changed local allocations to GLib
    functions
  virtiofsd/fuse_virtio.c: Changed allocations of locals to GLib

 tools/virtiofsd/fuse_lowlevel.c  | 31 ++++++++++++-----------------
 tools/virtiofsd/fuse_virtio.c    | 34 +++++++++++---------------------
 tools/virtiofsd/passthrough_ll.c | 21 ++++++++------------
 3 files changed, 32 insertions(+), 54 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-05-06 16:53 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 15:46 [PATCH v2 0/7] virtiofsd: Changed various allocations to GLib functions Mahmoud Mandour
2021-04-20 15:46 ` [PATCH v2 1/7] virtiofsd: Changed allocations of fuse_req " Mahmoud Mandour
2021-04-20 19:03   ` [Virtio-fs] " Vivek Goyal
2021-04-21  0:39     ` Mahmoud Mandour
2021-04-27  9:48       ` Dr. David Alan Gilbert
2021-04-20 15:46 ` [PATCH v2 2/7] virtiofds: Changed allocations of iovec to GLib's functions Mahmoud Mandour
2021-04-27 10:24   ` Dr. David Alan Gilbert
2021-04-27 10:53     ` Mahmoud Mandour
2021-04-27 11:01       ` Dr. David Alan Gilbert
2021-04-27 11:08         ` Mahmoud Mandour
2021-04-27 11:33           ` Dr. David Alan Gilbert
2021-04-27 18:13             ` [PATCH v3 2/7] virtiofsd: " Mahmoud Mandour
2021-05-06  9:39               ` Dr. David Alan Gilbert
2021-04-27 18:19             ` [PATCH v2 2/7] virtiofds: " Mahmoud Mandour
2021-04-27 18:41               ` Dr. David Alan Gilbert
2021-04-27 10:57     ` Daniel P. Berrangé
2021-04-20 15:46 ` [PATCH v2 3/7] virtiofsd: Changed allocations of fuse_session " Mahmoud Mandour
2021-04-20 15:46 ` [PATCH v2 4/7] virtiofsd: Changed allocation of lo_map_elems " Mahmoud Mandour
2021-04-20 15:46 ` [PATCH v2 5/7] virtiofsd: Changed allocations of fv_VuDev & its internals to GLib functions Mahmoud Mandour
2021-04-20 15:46 ` [PATCH v2 6/7] virtiofsd/passthrough_ll.c: Changed local allocations " Mahmoud Mandour
2021-04-20 15:46 ` [PATCH v2 7/7] virtiofsd/fuse_virtio.c: Changed allocations of locals to GLib Mahmoud Mandour
2021-05-06 16:27 ` [PATCH v2 0/7] virtiofsd: Changed various allocations to GLib functions Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).