From 1ff36b5d4d00a4e3633eb960bf2be562f5e47dbf Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 30 Oct 2015 12:10:00 +0100 Subject: buffer: add buffer_shrink Signed-off-by: Gerd Hoffmann Reviewed-by: Peter Lieven Reviewed-by: Daniel P. Berrange Message-id: 1446203414-4013-6-git-send-email-kraxel@redhat.com --- include/qemu/buffer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/qemu/buffer.h') diff --git a/include/qemu/buffer.h b/include/qemu/buffer.h index 1358df1aac..0a69b3a972 100644 --- a/include/qemu/buffer.h +++ b/include/qemu/buffer.h @@ -51,6 +51,16 @@ struct Buffer { void buffer_init(Buffer *buffer, const char *name, ...) GCC_FMT_ATTR(2, 3); +/** + * buffer_shrink: + * @buffer: the buffer object + * + * Try to shrink the buffer. Checks current buffer capacity and size + * and reduces capacity in case only a fraction of the buffer is + * actually used. + */ +void buffer_shrink(Buffer *buffer); + /** * buffer_reserve: * @buffer: the buffer object -- cgit 1.4.1