dynbuf: introduce internal generic dynamic buffer functions

A common set of functions instead of many separate implementations for
creating buffers that can grow when appending data to them. Existing
functionality has been ported over.

In my early basic testing, the total number of allocations seem at
roughly the same amount as before, possibly a few less.

See docs/DYNBUF.md for a description of the API.

Closes #5300
This commit is contained in:
Daniel Stenberg 2020-05-02 17:04:08 +02:00
parent 00c2e8da9a
commit ed35d6590e
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
27 changed files with 881 additions and 862 deletions

View file

@ -616,7 +616,7 @@ static CURLcode multi_done(struct Curl_easy *data,
/* if the transfer was completed in a paused state there can be buffered
data left to free */
for(i = 0; i < data->state.tempcount; i++) {
free(data->state.tempwrite[i].buf);
Curl_dyn_free(&data->state.tempwrite[i].b);
}
data->state.tempcount = 0;