Summary:
My previous change to re-implement IOBuf's internal storage mechanism
introduced a build failure when compiling with clang.
This fixes the new compilation error in IOBuf.cpp, as well as two
existing build failures in some of the unit tests.
Test Plan: Built the folly/io code with clang.
Reviewed By: andrewjcg@fb.com
FB internal diff:
D1082086
}
void IOBuf::releaseStorage(HeapStorage* storage, uint16_t freeFlags) {
}
void IOBuf::releaseStorage(HeapStorage* storage, uint16_t freeFlags) {
- CHECK_EQ(storage->prefix.magic, kHeapMagic);
+ CHECK_EQ(storage->prefix.magic, static_cast<uint16_t>(kHeapMagic));
// Use relaxed memory order here. If we are unlucky and happen to get
// out-of-date data the compare_exchange_weak() call below will catch
// Use relaxed memory order here. If we are unlucky and happen to get
// out-of-date data the compare_exchange_weak() call below will catch
destructorCount = 0;
{
std::unique_ptr<OwnershipTestClass[], CustomDeleter>
destructorCount = 0;
{
std::unique_ptr<OwnershipTestClass[], CustomDeleter>
- p(new OwnershipTestClass[2], customDeleteArray);
+ p(new OwnershipTestClass[2], CustomDeleter(customDeleteArray));
std::unique_ptr<IOBuf> buf(IOBuf::takeOwnership(std::move(p), 2));
EXPECT_EQ(2 * sizeof(OwnershipTestClass), buf->length());
EXPECT_EQ(0, destructorCount);
std::unique_ptr<IOBuf> buf(IOBuf::takeOwnership(std::move(p), 2));
EXPECT_EQ(2 * sizeof(OwnershipTestClass), buf->length());
EXPECT_EQ(0, destructorCount);
-ByteRange br(StringPiece sp) { return ByteRange(sp); }
StringPiece sp(ByteRange br) { return StringPiece(br); }
template <class T>
StringPiece sp(ByteRange br) { return StringPiece(br); }
template <class T>