From: Nicholas Ormrod Date: Wed, 26 Nov 2014 01:42:05 +0000 (-0800) Subject: IOBuf::moveToFbString legacy 4GiB limit X-Git-Tag: v0.22.0~143 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=929e93d49bfe69a76b848c03aacf4164621dd3dd;p=folly.git IOBuf::moveToFbString legacy 4GiB limit Summary: IOBufs now support larger than 4GiB chunks. One of the checks was not removed. Tracing through the capacity, its use if all 64-bit compatible. Test Plan: moveToFbString a 4GiB+ IOBuf element. Reviewed By: maxim@fb.com Subscribers: net-systems@, sdwilsh, njormrod, folly-diffs@ FB internal diff: D1705316 Tasks: 5648445 Signature: t1:1705316:1416965241:d9d064bbde53e033d32bfe872b3445ee59005f5e --- diff --git a/folly/io/IOBuf.cpp b/folly/io/IOBuf.cpp index e47c2faa..90517aea 100644 --- a/folly/io/IOBuf.cpp +++ b/folly/io/IOBuf.cpp @@ -590,9 +590,6 @@ void IOBuf::coalesceAndReallocate(size_t newHeadroom, IOBuf* end, size_t newTailroom) { uint64_t newCapacity = newLength + newHeadroom + newTailroom; - if (newCapacity > UINT32_MAX) { - throw std::overflow_error("IOBuf chain too large to coalesce"); - } // Allocate space for the coalesced buffer. // We always convert to an external buffer, even if we happened to be an