/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2013-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <folly/Conv.h>
#include <folly/Likely.h>
-#include <folly/Malloc.h>
#include <folly/Memory.h>
#include <folly/ScopeGuard.h>
-#include <folly/SpookyHashV2.h>
+#include <folly/hash/SpookyHashV2.h>
#include <folly/io/Cursor.h>
+#include <folly/lang/Align.h>
+#include <folly/memory/Malloc.h>
using std::unique_ptr;
}
}
-} // 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
HeapStorage hs;
SharedInfo shared;
- std::max_align_t align;
+ folly::max_align_t align;
};
IOBuf::SharedInfo::SharedInfo()
// - 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;
}
}
-} // folly
+} // namespace folly