diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-10-30 12:10:00 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-11-05 09:08:41 +0100 |
commit | 1ff36b5d4d00a4e3633eb960bf2be562f5e47dbf (patch) | |
tree | 4534dbf57bfeaf9611baa4b1041282a48c81b138 /include/qemu | |
parent | 830a9583206a051c240b74c3f688a015dc5d2967 (diff) | |
download | qemu-1ff36b5d4d00a4e3633eb960bf2be562f5e47dbf.zip qemu-1ff36b5d4d00a4e3633eb960bf2be562f5e47dbf.tar.gz qemu-1ff36b5d4d00a4e3633eb960bf2be562f5e47dbf.tar.bz2 |
buffer: add buffer_shrink
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1446203414-4013-6-git-send-email-kraxel@redhat.com
Diffstat (limited to 'include/qemu')
-rw-r--r-- | include/qemu/buffer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/qemu/buffer.h b/include/qemu/buffer.h index 1358df1..0a69b3a 100644 --- a/include/qemu/buffer.h +++ b/include/qemu/buffer.h @@ -52,6 +52,16 @@ 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 * @len: the minimum required free space |