From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzqLJ-000867-VF for qemu-devel@nongnu.org; Fri, 20 Nov 2015 13:23:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzqLJ-0006VF-17 for qemu-devel@nongnu.org; Fri, 20 Nov 2015 13:23:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzqLI-0006V4-Q2 for qemu-devel@nongnu.org; Fri, 20 Nov 2015 13:23:28 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 4EF3CC0B89C8 for ; Fri, 20 Nov 2015 18:23:28 +0000 (UTC) References: <1448010269-21694-1-git-send-email-pbonzini@redhat.com> <1448010269-21694-2-git-send-email-pbonzini@redhat.com> From: Eric Blake Message-ID: <564F651A.6090107@redhat.com> Date: Fri, 20 Nov 2015 11:23:22 -0700 MIME-Version: 1.0 In-Reply-To: <1448010269-21694-2-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="llETaPm1eJvkGM1nwJ2qg5rjoSdcBphVt" Subject: Re: [Qemu-devel] [PATCH 1/4] qjson: replace QString in JSONLexer with GString List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --llETaPm1eJvkGM1nwJ2qg5rjoSdcBphVt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/20/2015 02:04 AM, Paolo Bonzini wrote: > JSONLexer only needs a simple resizable buffer. json-streamer.c > can allocate memory for each token instead of relying on reference > counting of QStrings. >=20 > Signed-off-by: Paolo Bonzini > --- > include/qapi/qmp/json-lexer.h | 7 +++---- > include/qapi/qmp/json-streamer.h | 1 + > qobject/json-lexer.c | 22 ++++++++-------------- > qobject/json-streamer.c | 10 +++++----- > 4 files changed, 17 insertions(+), 23 deletions(-) >=20 > --- a/include/qapi/qmp/json-streamer.h > +++ b/include/qapi/qmp/json-streamer.h > @@ -14,6 +14,7 @@ > #ifndef QEMU_JSON_STREAMER_H > #define QEMU_JSON_STREAMER_H > =20 > +#include > #include "qapi/qmp/qlist.h" > #include "qapi/qmp/json-lexer.h" > =20 Spurious hunk? If not, should mention in the commit message why this is needed. > +++ b/qobject/json-streamer.c > @@ -12,6 +12,7 @@ > */ > =20 > #include "qapi/qmp/qlist.h" > +#include "qapi/qmp/qstring.h" > #include "qapi/qmp/qint.h" > #include "qapi/qmp/qdict.h" > #include "qemu-common.h" > @@ -21,13 +22,13 @@ > #define MAX_TOKEN_SIZE (64ULL << 20) > #define MAX_NESTING (1ULL << 10) > =20 > -static void json_message_process_token(JSONLexer *lexer, QString *toke= n, JSONTokenType type, int x, int y) > +static void json_message_process_token(JSONLexer *lexer, GString *inpu= t, JSONTokenType type, int x, int y) Worth wrapping the long line while touching it? Otherwise looks like a straightforward conversion. If the commit message is fixed, you can add Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --llETaPm1eJvkGM1nwJ2qg5rjoSdcBphVt 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/ iQEcBAEBCAAGBQJWT2UaAAoJEKeha0olJ0NqC0YH/3bd90eXt1rTBcI6TqJ1D/De 5TGK/dvNk0mLB0f/lrdS4giPxKGrtLfwoQUTVAXB33IimZa3/5ZDomqjZ+Mawap4 ZTVqN7EePslaLNqxgAk3uttMQIKJctTITOecWzTBXoHaWc0IClhTsLAPYosxCuof R3bcLMM+L4pdLMjigSKmv4qJ1ywXegPGDoUI9HW2q116zsHVmC7TPbChynmNGJto rdCu+aOSW9pRPm04emP855TE6EbRtO/qSmyU5e0vb3YW3hxCFuz2v+UZhN6RUYmi hX/Glw6JZ5BKcyQ+2QgGW71eZVtyvnL/BTyWPCmwkkVch819leIn22dDeWmSAcc= =zsZ6 -----END PGP SIGNATURE----- --llETaPm1eJvkGM1nwJ2qg5rjoSdcBphVt--