[core] tweak buffer merging to reduce mem

tweak buffer merging in chunkqueue_append_buffer() to trade off
a slight increase in copying for slightly more constrained mem usage
personal/stbuehler/tests-path
Glenn Strauss 2021-07-22 16:37:41 -04:00
parent d958cf3262
commit 3f17f94336
1 changed files with 2 additions and 1 deletions

View File

@ -375,7 +375,8 @@ static int chunkqueue_append_mem_extend_chunk(chunkqueue * const restrict cq, co
void chunkqueue_append_buffer(chunkqueue * const restrict cq, buffer * const restrict mem) {
chunk *c;
size_t len = mem ? buffer_clen(mem) : 0;
if (len < 256 && chunkqueue_append_mem_extend_chunk(cq, mem->ptr, len)) return;
if (len < 1024 && chunkqueue_append_mem_extend_chunk(cq, mem->ptr, len))
return;
c = chunkqueue_append_mem_chunk(cq, chunk_buf_sz);
cq->bytes_in += len;