Bug 1486690 - Remove NS_ALIGNMENT_OF. r=glandium
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 28 Aug 2018 15:55:20 +1000
changeset 488851 7aa3a17103b6a4b504e448b0908bd60cb1f5705b
parent 488850 04849dfc7b7e66d5e930dbf8289e0b7fe71068ed
child 488852 e5734413c06fefcb1247c096af3e9241235d1857
push id9734
push usershindli@mozilla.com
push dateThu, 30 Aug 2018 12:18:07 +0000
treeherdermozilla-beta@71c71ab3afae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1486690
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1486690 - Remove NS_ALIGNMENT_OF. r=glandium It's unused, and MFBT has MOZ_ALIGNOF.
xpcom/base/nsMemory.h
--- a/xpcom/base/nsMemory.h
+++ b/xpcom/base/nsMemory.h
@@ -102,32 +102,16 @@ public:
  *                  should be a int32_t.  Note that this means this macro
  *                  will not work if size >= 2^31.
  * @param array     The array to be freed.
  */
 #define NS_FREE_XPCOM_ISUPPORTS_POINTER_ARRAY(size, array)                    \
     NS_FREE_XPCOM_POINTER_ARRAY((size), (array), NS_IF_RELEASE)
 
 /**
- * A macro, NS_ALIGNMENT_OF(t_) that determines the alignment
- * requirements of a type.
- */
-namespace mozilla {
-template<class T>
-struct AlignmentTestStruct
-{
-  char c;
-  T t;
-};
-} // namespace mozilla
-
-#define NS_ALIGNMENT_OF(t_) \
-  (sizeof(mozilla::AlignmentTestStruct<t_>) - sizeof(t_))
-
-/**
  * An enumeration type used to represent a method of assignment.
  */
 enum nsAssignmentType
 {
   NS_ASSIGNMENT_COPY,   // copy by value
   NS_ASSIGNMENT_DEPEND, // copy by reference
   NS_ASSIGNMENT_ADOPT   // copy by reference (take ownership of resource)
 };