Bug 1533750 - pack members of PermissionEntry better on 64-bit platforms; r=jdm
authorNathan Froyd <froydnj@mozilla.com>
Mon, 11 Mar 2019 18:36:44 +0000
changeset 521441 cc930a52098b
parent 521440 583048926c12
child 521442 13a0c61ed4fc
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1533750
milestone67.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 1533750 - pack members of PermissionEntry better on 64-bit platforms; r=jdm The current ordering leaves a hole after `mExpireType` due to the need to align a 64-bit `mExpireTime` and another one after `mNonSessionExpireTime` to pad out the structure. We can group members by their type (and initialize them in that order to avoid compiler warnings) to avoid the holes and save a little bit of space. Differential Revision: https://phabricator.services.mozilla.com/D22713
extensions/cookie/nsPermissionManager.h
--- a/extensions/cookie/nsPermissionManager.h
+++ b/extensions/cookie/nsPermissionManager.h
@@ -44,31 +44,31 @@ class nsPermissionManager final : public
                                   public nsSupportsWeakReference {
  public:
   class PermissionEntry {
    public:
     PermissionEntry(int64_t aID, uint32_t aType, uint32_t aPermission,
                     uint32_t aExpireType, int64_t aExpireTime,
                     int64_t aModificationTime)
         : mID(aID),
+          mExpireTime(aExpireTime),
+          mModificationTime(aModificationTime),
           mType(aType),
           mPermission(aPermission),
           mExpireType(aExpireType),
-          mExpireTime(aExpireTime),
-          mModificationTime(aModificationTime),
           mNonSessionPermission(aPermission),
           mNonSessionExpireType(aExpireType),
           mNonSessionExpireTime(aExpireTime) {}
 
     int64_t mID;
+    int64_t mExpireTime;
+    int64_t mModificationTime;
     uint32_t mType;
     uint32_t mPermission;
     uint32_t mExpireType;
-    int64_t mExpireTime;
-    int64_t mModificationTime;
     uint32_t mNonSessionPermission;
     uint32_t mNonSessionExpireType;
     uint32_t mNonSessionExpireTime;
   };
 
   /**
    * PermissionKey is the key used by PermissionHashKey hash table.
    *