qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 1/2] qapi: change QmpOutputVisitor to QSLIST


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v3 1/2] qapi: change QmpOutputVisitor to QSLIST
Date: Thu, 07 Jul 2016 18:28:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Paolo Bonzini <address@hidden> writes:

> This saves a little memory compared to the doubly-linked QTAILQ.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  qapi/qmp-output-visitor.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c
> index 0452056..64aa42c 100644
> --- a/qapi/qmp-output-visitor.c
> +++ b/qapi/qmp-output-visitor.c
> @@ -23,15 +23,13 @@ typedef struct QStackEntry
>  {
>      QObject *value;
>      void *qapi; /* sanity check that caller uses same pointer */
> -    QTAILQ_ENTRY(QStackEntry) node;
> +    QSLIST_ENTRY(QStackEntry) node;
>  } QStackEntry;
>  
> -typedef QTAILQ_HEAD(QStack, QStackEntry) QStack;
> -
>  struct QmpOutputVisitor
>  {
>      Visitor visitor;
> -    QStack stack; /* Stack of containers that haven't yet been finished */
> +    QSLIST_HEAD(, QStackEntry) stack; /* Stack of containers that haven't 
> yet been finished */

Long line.  I'll squash in Eric's proposed fix on commit if you don't
mind:

       QSLIST_HEAD(...);           /* Stack of unfinished containers */

>      QObject *root; /* Root of the output visit */
>      QObject **result; /* User's storage location for result */
>  };
[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]