aboutsummaryrefslogtreecommitdiff
path: root/docs/devel
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2020-10-27 00:05:46 -0500
committerEric Blake <eblake@redhat.com>2020-10-30 15:10:14 -0500
commit159f8442382cff6ef6d858dbf02f03f0cc95b4a7 (patch)
tree2d70fc63e16af0666b69b8fcf03fd48a79b0280f /docs/devel
parentcb7223ac33fa35976d64f31145122965c1ba332d (diff)
downloadqemu-159f8442382cff6ef6d858dbf02f03f0cc95b4a7.zip
qemu-159f8442382cff6ef6d858dbf02f03f0cc95b4a7.tar.gz
qemu-159f8442382cff6ef6d858dbf02f03f0cc95b4a7.tar.bz2
block: Simplify QAPI_LIST_ADD
There is no need to rely on the verbosity of the gcc/clang compiler extension of g_new(typeof(X), 1) when we can instead use the standard g_malloc(sizeof(X)). In general, we like g_new over g_malloc for returning type X rather than void* to let the compiler catch more potential typing mistakes, but in this particular macro, our other use of typeof on the same line already ensures we are getting correct results. Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20201027050556.269064-2-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'docs/devel')
0 files changed, 0 insertions, 0 deletions