projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix zlib + lzma memory usage inefficiency
[folly.git]
/
folly
/
io
/
Compression.cpp
diff --git
a/folly/io/Compression.cpp
b/folly/io/Compression.cpp
index ae75b2a6a38a958c39ca4f6f32051eeeca21c6da..4a9deaaf554737c921562dfd687de6c81bc219c5 100644
(file)
--- a/
folly/io/Compression.cpp
+++ b/
folly/io/Compression.cpp
@@
-840,7
+840,7
@@
std::unique_ptr<IOBuf> ZlibCodec::addOutputBuffer(z_stream* stream,
CHECK_EQ(stream->avail_out, 0);
auto buf = IOBuf::create(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();
stream->next_out = buf->writableData();
stream->avail_out = buf->length();
@@
-1147,7
+1147,7
@@
std::unique_ptr<IOBuf> LZMA2Codec::addOutputBuffer(
CHECK_EQ(stream->avail_out, 0);
auto buf = IOBuf::create(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();
stream->next_out = buf->writableData();
stream->avail_out = buf->length();