qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 1/5] QJSON: Add JSON writer


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH v3 1/5] QJSON: Add JSON writer
Date: Tue, 06 Jan 2015 22:39:26 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 06.01.15 16:41, Eric Blake wrote:
> On 12/26/2014 07:42 AM, Alexander Graf wrote:
>> To support programmatic JSON assembly while keeping the code that
>> generates it readable, this patch introduces a simple JSON
>> writer. It emits JSON serially into a buffer in memory.
>> 
>> The nice thing about this writer is its simplicity and low memory
>> overhead. Unlike the QMP JSON writer, this one does not need to
>> spawn QObjects for every element it wants to represent.
>> 
>> This is a prerequisite for the migration stream format
>> description generator.
>> 
>> Signed-off-by: Alexander Graf <address@hidden> --- Makefile.objs
>> |  1 + include/qjson.h | 28 +++++++++++++++++ qjson.c         |
>> 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3
>> files changed, 126 insertions(+) create mode 100644
>> include/qjson.h create mode 100644 qjson.c
> 
>> +struct QJSON { +    QString *str; +    bool omit_comma; +
>> unsigned long self_size_offset;
> 
> Would size_t be smarter for this field?

Turns out the smartest thing to do is to remove the field - it was
unused :).


Btw, thanks a lot for the review!

Alex
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQIcBAEBAgAGBQJUrFYOAAoJECszeR4D/txgCFgP/0r29Xbr/5Ly0MJsP2TN9VcK
NKSL31izigBmQ60Z6cf8sTzqPwZ0mgrFEUBelqz102dWu2DXe+DHa0Uel15/Gxd2
ZR8RVtY86mIvSfdARGShF+pzcUdzMUKlliYbagQglb9zHnnRkYR0VtXy6G1CQczq
lzQDZT0OW9m75+/PPC2V1/g8aWYZbgODI0w+CKEFQM8znhq3qVqiFcRx3HuLHwch
8FiuLYen4XzGjOZDj2oLyU8Aescwkdot4AkfAgf63TJmN2zyhXZQy6BFuJOfoYJK
5no4k7xNvjHX83fx9cT0RdQ6fZzfF/NcRKNlMdJmoi+0dDe87mzahR4Yufs0X+ir
xPIRKXuQWSSJgroboHVQOAlg0IYNdYn5Km3JK8Jx9yBnl6Me0Ow5P6oI0ZAeorWF
vzf395oFq6m29uaMUtmyMfk8dL023xJYIbYr2euoP0gipVvWAKKnBpWc4nWVrq3y
6SnlMbzyA5mb4I0iHGyaQp4WGvFFA/uwW8k+Xz5KpMJgQQoIrtvDaUw0E3f+YHGC
x2/a3FLmxhDAYIBfKlSBWpejG5OuIT6Af5t5xvDO45B+izGVm3WPctEYVkkYTSeq
jaqDpkdBZY8HxG+oYnJzH8wxPSELLM61PqYZyrDTMPdzepthepYgXCSWTFmBMZD7
OhJSkVksn4Khk0x7l1gy
=5f/z
-----END PGP SIGNATURE-----



reply via email to

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