From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCAC-0001E1-86 for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLCA8-0006sv-MP for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:28:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCA8-0006so-Gr for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:28:28 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F20987F351 for ; Thu, 7 Jul 2016 16:28:27 +0000 (UTC) From: Markus Armbruster References: <1467906798-5312-1-git-send-email-pbonzini@redhat.com> <1467906798-5312-2-git-send-email-pbonzini@redhat.com> Date: Thu, 07 Jul 2016 18:28:25 +0200 In-Reply-To: <1467906798-5312-2-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Thu, 7 Jul 2016 17:53:17 +0200") Message-ID: <87twg1fm52.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v3 1/2] qapi: change QmpOutputVisitor to QSLIST List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini writes: > This saves a little memory compared to the doubly-linked QTAILQ. > > Signed-off-by: Paolo Bonzini > --- > 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 */ > }; [...]