Add IOBuf::cloneCoalesced()
authorNick Terrell <terrelln@fb.com>
Tue, 21 Mar 2017 18:13:36 +0000 (11:13 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 21 Mar 2017 18:20:07 +0000 (11:20 -0700)
commit630673beeb35e790ed27c38ea5abe1f5436cb08e
tree916d6e6ce016b3d6fdf4a1e457223878c37dde0b
parent68d5fb06281abea91eaa5813e0c919419cc2eb43
Add IOBuf::cloneCoalesced()

Summary:
`LZ4Codec::doCompress()` and `doUncompress()` need to coalesce a `const IOBuf*`, so they `clone()` and then `coalesce()`.
It is more efficient to do this in one step, as shown by the benchmarks.

Reviewed By: yfeldblum, simpkins

Differential Revision: D4727802

fbshipit-source-id: f8d5f6187f2ee804301232b3c75b848330169fc5
folly/io/Compression.cpp
folly/io/IOBuf.cpp
folly/io/IOBuf.h
folly/io/test/IOBufBenchmark.cpp
folly/io/test/IOBufTest.cpp