Clean-up: simplify the implementation of dynamic buffer set_capacity
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 10:59:18 +0000 (06:59 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 May 2017 16:39:26 +0000 (12:39 -0400)
commit5b1dd5fb3a3ad3fa972bba3a1916012c018727ff
tree56c5fbe3dfb6f07db26d2654c742ce2acb239f4c
parent9d02a17a3c5926d49fde4e9ee3b2208152be8ef1
Clean-up: simplify the implementation of dynamic buffer set_capacity

Only use realloc() to implement set_capacity's logic. In the case
where buf is NULL, realloc acts like malloc() anyhow.

Moreover, the memory does not need to be zeroed on allocation since
size increases provide this guarantee.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/dynamic-buffer.c
This page took 0.025262 seconds and 4 git commands to generate.