winedbg: Use exponential growth in gdbproxy reply_buffer_grow.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jinoh Kang 2021-11-24 00:09:53 +09:00 committed by Alexandre Julliard
parent 9b29182ca7
commit 16df778627
1 changed files with 7 additions and 2 deletions

View File

@ -236,9 +236,14 @@ static void reply_buffer_clear(struct reply_buffer* reply)
static void reply_buffer_grow(struct reply_buffer* reply, size_t size)
{
if (reply->alloc < reply->len + size)
size_t required_alloc = reply->len + size;
if (reply->alloc < required_alloc)
{
reply->alloc = ((reply->len + size) / 32 + 1) * 32;
reply->alloc = reply->alloc * 3 / 2;
if (reply->alloc < required_alloc)
reply->alloc = required_alloc;
reply->base = realloc(reply->base, reply->alloc);
}
}