]> Git Repo - qemu.git/blobdiff - include/qemu/buffer.h
buffer: add buffer_shrink
[qemu.git] / include / qemu / buffer.h
index 1358df1aac4e1a2164fc4064536fcb5f348c92ef..0a69b3a97224cbcb519a59937a39e45cc0beb75d 100644 (file)
@@ -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
This page took 0.022953 seconds and 4 git commands to generate.