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>
Sun, 28 May 2017 13:19:12 +0000 (09:19 -0400)
commitfc804d0faf10919d60471e8b9599caad02cc7194
tree9ffbcf07bf8f1d3364384685568f1e09434d7b4f
parent1c6def05e37f4a8a828a94aa0ca0e6236877f26f
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.034074 seconds and 4 git commands to generate.