Commit 9016ec6f authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 6

PackedSyncPtr.data_ is private

Summary: As the (now removed) comment says, GCC 4.6 doesn't treat structs with private members as POD types... The thing is, GCC 4.6 is long dead, so make `data_` private and assert that it's a POD type.

Reviewed By: meyering

Differential Revision: D3373172

fbshipit-source-id: b2f1ee59d544461fe986705164cc6c866af62865
parent 70497e41
......@@ -133,14 +133,13 @@ public:
data_.setData((uintptr_t(extra) << 48) | ptr);
}
// Logically private, but we can't have private data members and
// still be considered a POD. (In C++11 we are still a standard
// layout struct if this is private, but it doesn't matter, since
// gcc (4.6) won't let us use this with attribute packed still in
// that case.)
private:
PicoSpinLock<uintptr_t> data_;
};
static_assert(
std::is_pod<PackedSyncPtr<void>>::value,
"PackedSyncPtr must be kept a POD type.");
static_assert(sizeof(PackedSyncPtr<void>) == 8,
"PackedSyncPtr should be only 8 bytes---something is "
"messed up");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment