Add isManaged / makeManaged
authorTudor Bosman <tudorb@fb.com>
Wed, 8 Jul 2015 15:39:55 +0000 (08:39 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 9 Jul 2015 22:32:54 +0000 (15:32 -0700)
commit58059b6eaa7e22e3bf97b5a270ff9fe219368d6c
tree7b9d2583768240bee7c80856417bf75550eb2bd4
parent6caa69566e8e747ffcdb5fb5499315b0e5703ef7
Add isManaged / makeManaged

Summary: Add a way to tell whether an IOBuf (either indvidually or the whole chain)
refers to memory that's outside of IOBuf's control (via WRAP_BUFFER). That is,
can you assume that clone() will extend the lifetime of the memory? Is it safe
to use clone() instead of copying the data (and avoid a copy)?

Reviewed By: @simpkins

Differential Revision: D2191883
folly/io/IOBuf.cpp
folly/io/IOBuf.h
folly/io/test/IOBufTest.cpp