Bug 1417806 - Reduce gPrefNameArena's alignment to 1. r=glandium. draft
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 16 Nov 2017 16:02:07 +1100
changeset 698936 1f7d337875d5f554772bec6395e7f4241900a26c
parent 698935 9feafbb4c92c6b9dbe37466fefb777a8638b1c6e
child 698937 3c7b35684b94b8aeabb73e0eb278a51ef8a4697b
push id89395
push usernnethercote@mozilla.com
push dateThu, 16 Nov 2017 08:14:02 +0000
reviewersglandium
bugs1417806
milestone59.0a1
Bug 1417806 - Reduce gPrefNameArena's alignment to 1. r=glandium. Because it holds 8-bit strings, which only need 1 byte alignment. For the profile on my Linux box, in every process this reduces the size of the arena by 1 chunk, from 120 KiB to 112 KiB. MozReview-Commit-ID: 8ozrLIq5ZZ4
modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -312,17 +312,17 @@ struct CallbackNode
   PrefChangedFunc mFunc;
   void* mData;
   Preferences::MatchKind mMatchKind;
   CallbackNode* mNext;
 };
 
 static PLDHashTable* gHashTable;
 
-static ArenaAllocator<8192, 4> gPrefNameArena;
+static ArenaAllocator<8192, 1> gPrefNameArena;
 
 // The callback list contains all the priority callbacks followed by the
 // non-priority callbacks. gLastPriorityNode records where the first part ends.
 static CallbackNode* gFirstCallback = nullptr;
 static CallbackNode* gLastPriorityNode = nullptr;
 
 static bool gIsAnyPrefLocked = false;