X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Fio%2FIOBuf.cpp;h=35c4e102bf49d85f01dd08af97a65acdbc864df9;hb=18435bce240108397da4ba1ce0b9db317272b7fd;hp=fb3c1b5c0d56689733632b503e2042f1d5c84ec1;hpb=60825c9bca47c6919ad192527dacd052b02e13b9;p=folly.git diff --git a/folly/io/IOBuf.cpp b/folly/io/IOBuf.cpp index fb3c1b5c..35c4e102 100644 --- a/folly/io/IOBuf.cpp +++ b/folly/io/IOBuf.cpp @@ -112,7 +112,7 @@ struct IOBuf::HeapFullStorage { HeapStorage hs; SharedInfo shared; - MaxAlign align; + std::max_align_t align; }; IOBuf::SharedInfo::SharedInfo() @@ -552,6 +552,19 @@ void IOBuf::unshareChained() { coalesceSlow(); } +void IOBuf::makeManagedChained() { + assert(isChained()); + + IOBuf* current = this; + while (true) { + current->makeManagedOne(); + current = current->next_; + if (current == this) { + break; + } + } +} + void IOBuf::coalesceSlow() { // coalesceSlow() should only be called if we are part of a chain of multiple // IOBufs. The caller should have already verified this.