All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] introduce QArray
@ 2021-08-22 13:21 Christian Schoenebeck
  2021-08-22 13:16 ` [PATCH v2 1/5] qemu/qarray.h: " Christian Schoenebeck
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Christian Schoenebeck @ 2021-08-22 13:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Greg Kurz, Richard Henderson

Patches 1 and 2 introduce include/qemu/qarray.h which implements a deep auto
free mechanism for arrays. Unlike GArray it does not require special macros,
function calls or member dereferencing to access the individual array
elements. So existing C-style array code can be retained with only very
little changes.

In this initial version QArray only supports the concept of unique pointers,
i.e. it does not support reference counting. The array (and all dynamically
allocated memory of individual array elements) is auto freed once execution
leaves the scope of the reference variable (unique pointer) associated with
the array.

Patches 3..5 are provided (e.g. as example) for 9p being the first user of
this new QArray API. These particular patches 3..5 are rebased on my
current 9p queue: https://github.com/cschoenebeck/qemu/commits/9p.next
which are basically just the following two queued patches:

https://github.com/cschoenebeck/qemu/commit/7772715d43908235940f5b7dec68d0458b1ccdf4
https://github.com/cschoenebeck/qemu/commit/838b55e392ea7d52e714fdba1db777f658aee2cc

v1 -> v2:

    * Minor API comment changes [patch 1].

    * Perform strong type check by using __builtin_types_compatible_p()
      instead of a weak check using sizeof() [patch 2].

Christian Schoenebeck (5):
  qemu/qarray.h: introduce QArray
  qemu/qarray.h: check scalar type in QARRAY_CREATE()
  9pfs: make V9fsString usable via QArray API
  9pfs: make V9fsPath usable via QArray API
  9pfs: use QArray in v9fs_walk()

 fsdev/9p-marshal.c    |   2 +
 fsdev/9p-marshal.h    |   3 +
 fsdev/file-op-9p.h    |   2 +
 hw/9pfs/9p.c          |  19 ++---
 include/qemu/qarray.h | 156 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 170 insertions(+), 12 deletions(-)
 create mode 100644 include/qemu/qarray.h

-- 
2.20.1



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

end of thread, other threads:[~2021-09-30 14:19 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-22 13:21 [PATCH v2 0/5] introduce QArray Christian Schoenebeck
2021-08-22 13:16 ` [PATCH v2 1/5] qemu/qarray.h: " Christian Schoenebeck
2021-08-24  8:22   ` Markus Armbruster
2021-08-24 11:51     ` Christian Schoenebeck
2021-08-24 14:45       ` Markus Armbruster
2021-08-24 15:24         ` Christian Schoenebeck
2021-08-24 15:28           ` Christian Schoenebeck
2021-08-25  8:15             ` Markus Armbruster
2021-08-24 11:58   ` Christian Schoenebeck
2021-08-24 14:21     ` Markus Armbruster
2021-09-28 13:04   ` Daniel P. Berrangé
2021-09-28 16:23     ` Christian Schoenebeck
2021-09-28 16:41       ` Daniel P. Berrangé
2021-09-29 17:32         ` Christian Schoenebeck
2021-09-29 17:48           ` Daniel P. Berrangé
2021-09-30 13:20             ` Christian Schoenebeck
2021-09-30 13:31               ` Daniel P. Berrangé
2021-09-30 13:55                 ` Christian Schoenebeck
2021-09-30 14:01                   ` Daniel P. Berrangé
2021-09-30 14:17                     ` Christian Schoenebeck
2021-08-22 13:17 ` [PATCH v2 2/5] qemu/qarray.h: check scalar type in QARRAY_CREATE() Christian Schoenebeck
2021-08-22 13:17 ` [PATCH v2 3/5] 9pfs: make V9fsString usable via QArray API Christian Schoenebeck
2021-08-22 13:17 ` [PATCH v2 4/5] 9pfs: make V9fsPath " Christian Schoenebeck
2021-08-22 13:17 ` [PATCH v2 5/5] 9pfs: use QArray in v9fs_walk() Christian Schoenebeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.