19 #include <type_traits> 21 #include <glog/logging.h> 26 #if !FOLLY_X64 && !FOLLY_PPC64 && !FOLLY_AARCH64 27 #error "PackedSyncPtr is x64, ppc64 or aarch64 specific code." 78 auto intPtr =
reinterpret_cast<uintptr_t
>(initialPtr);
79 CHECK(!(intPtr >> 48));
90 auto intPtr =
reinterpret_cast<uintptr_t
>(
t);
91 auto shiftedExtra = uintptr_t(
extra()) << 48;
92 CHECK(!(intPtr >> 48));
104 return reinterpret_cast<T*
>(
data_.
getData() & (-1ull >> 16));
144 CHECK(!(extra & 0x8000));
155 "PackedSyncPtr must be kept a POD type.");
158 "PackedSyncPtr should be only 8 bytes---something is " 161 template <
typename T>
162 std::ostream& operator<<(std::ostream& os, const PackedSyncPtr<T>&
ptr) {
163 os <<
"PackedSyncPtr(" <<
ptr.get() <<
", " <<
ptr.extra() <<
")";
FOLLY_PACK_PUSH struct folly::Unaligned< T, typename std::enable_if< std::is_pod< T >::value >::type > FOLLY_PACK_ATTR
void setExtra(uint16_t extra)
—— Concurrent Priority Queue Implementation ——
void init(IntType initialValue=0)
reference operator[](std::ptrdiff_t i) const
void init(T *initialPtr=nullptr, uint16_t initialExtra=0)
PicoSpinLock< uintptr_t > data_
std::add_lvalue_reference< T >::type reference
reference operator*() const
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)