Whether a clone may point at buffers that IOBuf does not own.
Declared in <folly/io/Cursor.h>
enum class CloneOwnership : int;
Cloning shares the underlying buffers, which keeps the data alive only if those buffers are managed (that is, reference counted by IOBuf).
Requesting Managed instead yields a clone that owns its data: managed buffers are still shared, and data backed by user-owned memory is copied out into buffers sized to hold just the cloned range.
| Name | Description |
|---|---|
Shared | Share the buffers. The clone is valid only while unmanaged data lives. |
Managed | Copy out unmanaged data, so that the clone owns everything it points at. |