Bug 1287006 - Put Maybe::mIsSome after mStorage to allow for possible efficient packing. - r=waldo
MozReview-Commit-ID: 6SmVUkRDM7s
--- a/mfbt/Maybe.h
+++ b/mfbt/Maybe.h
@@ -77,18 +77,18 @@ struct Nothing { };
*
* N.B. GCC has missed optimizations with Maybe in the past and may generate
* extra branches/loads/stores. Use with caution on hot paths; it's not known
* whether or not this is still a problem.
*/
template<class T>
class Maybe
{
+ AlignedStorage2<T> mStorage;
bool mIsSome;
- AlignedStorage2<T> mStorage;
public:
typedef T ValueType;
Maybe() : mIsSome(false) { }
~Maybe() { reset(); }
MOZ_IMPLICIT Maybe(Nothing) : mIsSome(false) { }