aboutsummaryrefslogtreecommitdiff
path: root/include/qemu
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2015-10-30 12:10:14 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-11-05 09:09:58 +0100
commitf14c3d85b003d8614144ae67a26157667c1e1245 (patch)
tree0ffdab65f95a165d8a9000351ac0e22364cf39e8 /include/qemu
parent4ec5ba151ff3f2ac8dc44dabd058eca5846654a6 (diff)
downloadqemu-f14c3d85b003d8614144ae67a26157667c1e1245.zip
qemu-f14c3d85b003d8614144ae67a26157667c1e1245.tar.gz
qemu-f14c3d85b003d8614144ae67a26157667c1e1245.tar.bz2
buffer: allow a buffer to shrink gracefully
the idea behind this patch is to allow the buffer to shrink, but make this a seldom operation. The buffers average size is measured exponentionally smoothed with am alpha of 1/128. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-20-git-send-email-kraxel@redhat.com
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/buffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/qemu/buffer.h b/include/qemu/buffer.h
index 0a69b3a..dead9b7 100644
--- a/include/qemu/buffer.h
+++ b/include/qemu/buffer.h
@@ -37,6 +37,7 @@ struct Buffer {
char *name;
size_t capacity;
size_t offset;
+ uint64_t avg_size;
uint8_t *buffer;
};