Optimize copy/move
authorPavlo Kushnir <pavlo@fb.com>
Wed, 4 May 2016 07:27:53 +0000 (00:27 -0700)
committerFacebook Github Bot 6 <facebook-github-bot-6-bot@fb.com>
Wed, 4 May 2016 07:35:25 +0000 (00:35 -0700)
commit1c523f26df01d9f6c877a89fd330f2e4a1a69e5a
tree67a1d7dd4539bb04b61349e08d4e627d7f09956d
parentd0ed189073b29b342ea68e2371d498b7fcabb791
Optimize copy/move

Summary: this diff provides methods that allow to avoid temporaries while cloning IOBufs. Also optimizes move constructor a bit - there is no need to call `decrementRefCount`, check for self assignment, etc.

Reviewed By: yfeldblum

Differential Revision: D3250456

fb-gh-sync-id: 32b0180c28f36151c6786dba6f511b491b224200
fbshipit-source-id: 32b0180c28f36151c6786dba6f511b491b224200
folly/io/IOBuf.cpp
folly/io/IOBuf.h
folly/io/test/IOBufBenchmark.cpp [new file with mode: 0644]
folly/io/test/IOBufTest.cpp