]> git.ipfire.org Git - thirdparty/libvirt.git/commit
memory: make it safer to expand arrays
authorEric Blake <eblake@redhat.com>
Fri, 13 Aug 2010 21:00:47 +0000 (15:00 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 18 Nov 2010 19:11:43 +0000 (12:11 -0700)
commit5a0beacc12e96e706ec4831a9d7ca68146574ff6
tree3b08be4db2ac4d38aa1232ec2dd64436113a42c5
parentb503022e573edc95046775ebe2e774881bdece1d
memory: make it safer to expand arrays

* src/util/memory.h (VIR_REALLOC_N): Update docs.
(VIR_EXPAND_N, VIR_SHRINK_N): New macros.
(virAlloc, virAllocN, virReallocN, virAllocVar, virFree): Add some
gcc attributes.
* src/util/memory.c (virExpandN, virShrinkN): New functions.
(virReallocN): Update docs.
* src/libvirt_private.syms: Export new helpers.
* docs/hacking.html.in: Prefer newer interfaces over
VIR_REALLOC_N, since uninitialized memory can bite us.
* HACKING: Regenerate.
HACKING
docs/hacking.html.in
src/libvirt_private.syms
src/util/memory.c
src/util/memory.h