From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr57Y-0006TT-OF for qemu-devel@nongnu.org; Tue, 27 Oct 2015 10:21:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr57U-0003Xg-Kn for qemu-devel@nongnu.org; Tue, 27 Oct 2015 10:21:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr57U-0003XY-Aj for qemu-devel@nongnu.org; Tue, 27 Oct 2015 10:21:00 -0400 References: <1445898903-12082-1-git-send-email-eblake@redhat.com> <1445898903-12082-11-git-send-email-eblake@redhat.com> <87si4wiw84.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <562F884A.4080004@redhat.com> Date: Tue, 27 Oct 2015 08:20:58 -0600 MIME-Version: 1.0 In-Reply-To: <87si4wiw84.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UrX7IWfRnqXDw5VVkHENbQuwrb5Naumss" Subject: Re: [Qemu-devel] [PATCH v11 10/24] qapi: Unbox base members List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Luiz Capitulino , Gerd Hoffmann , qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UrX7IWfRnqXDw5VVkHENbQuwrb5Naumss Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/27/2015 01:52 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Rather than storing a base class as a pointer to a box, just >> store the fields of that base class in the same order, so that >> a child struct can be directly cast to its parent. This gives >> less malloc overhead, less pointer dereferencing, and even less >> generated code. Compare to the earlier commit 1e6c1616a "qapi: >> Generate a nicer struct for flat unions" (although that patch >> had fewer places to change, as less of qemu was directly using >> qapi structs for flat unions). It also allows us to turn on >> automatic type-safe wrappers for upcasting to the base class >> of a struct. >> >> Changes to the generated code look like this in qapi-types.h: >> >> | struct SpiceChannel { >> |- SpiceBasicInfo *base; >> |+ /* Members inherited from SpiceBasicInfo: */ >> |+ char *host; >> |+ char *port; >> |+ NetworkAddressFamily family; >> |+ /* Own members: */ >> | int64_t connection_id; >> >> as well as added upcast functions like qapi_SpiceChannel_base(). >=20 > "additional upcast functions" sounds better to my ears. Indeed. >=20 > Patch looks good. I can touch up the commit message in my tree. Yay - looks like we won't need a v12. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --UrX7IWfRnqXDw5VVkHENbQuwrb5Naumss Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWL4hKAAoJEKeha0olJ0Nq7DUH/RM6ipyyh+UJjLOwHuH16XJJ x/BNU+uFhNm3Sh07DY7mF4TqUwB7tZI+lJN1V9/uJY0zD4bv9KbWAN68k6paacLO aUyo/onqkGWftvvofVCkPCRBeIW1wubSinN3rqPLxJQw3WECGDLnLluucoigm/fs hZF/DaflVHGBTFIAnDoDclDJzTHpfG51/MMTONlqPve/zbHKyFRvxSrYbHEJWJGL RVg/QqwsKxR+8/OgOA+gxJFGVpVzPSH8JCpJk3Gb8/PC4UKPH+US6YLiOikl24Ww SGK6VV0B2anhE6ppA1K3xVLaSKD73kRwcdx6CmSdfsfG+c73qytPgur9jGIOUx4= =Ibij -----END PGP SIGNATURE----- --UrX7IWfRnqXDw5VVkHENbQuwrb5Naumss--