mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 898916 - Properly align statically allocated classinfo objects. r=bsmedberg
This commit is contained in:
parent
32495789b5
commit
378ab5094e
@ -7,6 +7,7 @@
|
||||
|
||||
#include "nsIClassInfo.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
@ -119,13 +120,13 @@ private:
|
||||
_flags | nsIClassInfo::SINGLETON_CLASSINFO, \
|
||||
_cid, \
|
||||
}; \
|
||||
static char k##_class##ClassInfoDataPlace[sizeof(GenericClassInfo)]; \
|
||||
mozilla::AlignedStorage2<GenericClassInfo> k##_class##ClassInfoDataPlace; \
|
||||
nsIClassInfo* NS_CLASSINFO_NAME(_class) = NULL;
|
||||
|
||||
#define NS_IMPL_QUERY_CLASSINFO(_class) \
|
||||
if ( aIID.Equals(NS_GET_IID(nsIClassInfo)) ) { \
|
||||
if (!NS_CLASSINFO_NAME(_class)) \
|
||||
NS_CLASSINFO_NAME(_class) = new (k##_class##ClassInfoDataPlace) \
|
||||
NS_CLASSINFO_NAME(_class) = new (k##_class##ClassInfoDataPlace.addr()) \
|
||||
GenericClassInfo(&k##_class##ClassInfoData); \
|
||||
foundInterface = NS_CLASSINFO_NAME(_class); \
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user