Paolo Bonzini <pbonz...@redhat.com> writes:

> This saves a little memory compared to the doubly-linked QTAILQ.
>
> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
> ---
>  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