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 524439 cc930a52098bb3b8ebe042e6cf4739f8c470cad5
parent 524438 583048926c121b876326a536f44e14034035372c
child 524440 13a0c61ed4fcc2383ad2ca20f352ce6b43f85904
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [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.
    *