Code

utils strbuf: Added 'min_size' to be considered when shrinking the buffer.
authorSebastian Harl <sh@tokkee.org>
Wed, 17 Sep 2014 09:10:13 +0000 (11:10 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 17 Sep 2014 09:10:13 +0000 (11:10 +0200)
commit3cd97771183ee38e5fc8c3b2268cffce3c2cb27c
tree8586abafb7a79e55a9aed5d73196184f1c632b11
parentba12a0c8bc23d1be74cd85b441c800d4d29ab9fa
utils strbuf: Added 'min_size' to be considered when shrinking the buffer.

It's set to the initial size of the buffer (or 64). The idea is that the
initial size should provide an estimate of a reasonable size and shrinking the
buffer below that size causes unecessary churn.

For example, this is important for the frontend's command handlers which
usually need a large buffer size but initial writes to the buffer may be
small.
src/utils/strbuf.c
t/unit/utils/strbuf_test.c