X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FPackedSyncPtr.h;h=3db7ff1696a70eab40a62997ec9af8f63e30ea5b;hb=da873b7bd9cc2b01861e8e2b3f35b1da30be6945;hp=97ff844c23595f39fbc477b10b2d0aeaee5617bf;hpb=80c7ef06203a251bdc5ea88134847e386970f50d;p=folly.git diff --git a/folly/PackedSyncPtr.h b/folly/PackedSyncPtr.h index 97ff844c..3db7ff16 100644 --- a/folly/PackedSyncPtr.h +++ b/folly/PackedSyncPtr.h @@ -1,5 +1,5 @@ /* - * Copyright 2015 Facebook, Inc. + * Copyright 2016 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_PACKEDSYNCPTR_H_ -#define FOLLY_PACKEDSYNCPTR_H_ +#pragma once #include @@ -134,18 +133,15 @@ 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 data_; -}; +} FOLLY_PACK_ATTR; +static_assert( + std::is_pod>::value, + "PackedSyncPtr must be kept a POD type."); static_assert(sizeof(PackedSyncPtr) == 8, "PackedSyncPtr should be only 8 bytes---something is " "messed up"); } - -#endif