Summary:
Since IOBuf rounds to a good malloc size, zlib and lzma waste space.
For a 4 MiB `length`, about 1 MiB of the IOBuf is wasted.
Reviewed By: yfeldblum
Differential Revision:
D4872830
fbshipit-source-id:
42fc83277b2dae22b75403e0e71c43e8f2b19f21
CHECK_EQ(stream->avail_out, 0);
auto buf = IOBuf::create(length);
- buf->append(length);
+ buf->append(buf->capacity());
stream->next_out = buf->writableData();
stream->avail_out = buf->length();
CHECK_EQ(stream->avail_out, 0);
auto buf = IOBuf::create(length);
- buf->append(length);
+ buf->append(buf->capacity());
stream->next_out = buf->writableData();
stream->avail_out = buf->length();