mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
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
This commit is contained in:
parent
4ec5ba151f
commit
f14c3d85b0
2 changed files with 34 additions and 8 deletions
|
@ -37,6 +37,7 @@ struct Buffer {
|
|||
char *name;
|
||||
size_t capacity;
|
||||
size_t offset;
|
||||
uint64_t avg_size;
|
||||
uint8_t *buffer;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue