X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Fio%2FIOBuf.cpp;h=7206fc4652e13202d4c796d05d84b138c97ddbc6;hb=ecd0fb38477b04e36685a0808a904fd9080f50b1;hp=3ca39aa269da41d9d196d3e014dfa29af7f95558;hpb=2177f05a16891e5dc381ccfa56d36ce91418aa09;p=folly.git diff --git a/folly/io/IOBuf.cpp b/folly/io/IOBuf.cpp index 3ca39aa2..7206fc46 100644 --- a/folly/io/IOBuf.cpp +++ b/folly/io/IOBuf.cpp @@ -27,11 +27,11 @@ #include #include -#include #include #include -#include +#include #include +#include using std::unique_ptr; @@ -79,14 +79,12 @@ void takeOwnershipError(bool freeOnError, void* buf, } } -} // unnamed namespace +} // namespace namespace folly { struct IOBuf::HeapPrefix { - HeapPrefix(uint16_t flg) - : magic(kHeapMagic), - flags(flg) {} + explicit HeapPrefix(uint16_t flg) : magic(kHeapMagic), flags(flg) {} ~HeapPrefix() { // Reset magic to 0 on destruction. This is solely for debugging purposes // to help catch bugs where someone tries to use HeapStorage after it has @@ -793,7 +791,7 @@ void IOBuf::reserveSlow(uint64_t minHeadroom, uint64_t minTailroom) { // - If using jemalloc, we can try to expand in place, avoiding a memcpy() // - If not using jemalloc and we don't have too much to copy, // we'll use realloc() (note that realloc might have to copy - // headroom + data + tailroom, see smartRealloc in folly/Malloc.h) + // headroom + data + tailroom, see smartRealloc in folly/memory/Malloc.h) // - Otherwise, bite the bullet and reallocate. if (headroom() + tailroom() >= minHeadroom + minTailroom) { uint8_t* newData = writableBuffer() + minHeadroom; @@ -1050,4 +1048,4 @@ bool IOBufEqual::operator()(const IOBuf& a, const IOBuf& b) const { } } -} // folly +} // namespace folly