Closed
Bug 1351804
Opened 9 years ago
Closed 9 years ago
Switch libpref over to ArenaAllocator
Categories
(Core :: Preferences: Backend, enhancement)
Core
Preferences: Backend
Tracking
()
RESOLVED
FIXED
mozilla55
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | fixed |
People
(Reporter: erahm, Assigned: erahm)
References
Details
Attachments
(1 file)
|
6.17 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
MozReview-Commit-ID: 4GovbBFUBb9
| Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8852619 -
Flags: review?(nfroyd)
Comment 2•9 years ago
|
||
Comment on attachment 8852619 [details] [diff] [review]
Switch libpref over to ArenaAllocator
Review of attachment 8852619 [details] [diff] [review]:
-----------------------------------------------------------------
::: modules/libpref/prefapi.cpp
@@ +66,5 @@
> return (strcmp(prefEntry->key, otherKey) == 0);
> }
>
> PLDHashTable* gHashTable;
> +static ArenaAllocator<8192,4> gPrefNameArena;
I'm not super-excited about the static constructor this is going to add. Maybe we can make the ArenaAllocator constructor constexpr to avoid that?
Or, alternatively, we could have:
struct GlobalPrefState
{
// Add the obvious constructor, etc.
PLDHashTable mHashTable;
ArenaAllocator<...> mPrefNameArena;
};
static GlobalPrefState* gState;
and use that everywhere?
Attachment #8852619 -
Flags: review?(nfroyd) → review+
| Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #2)
> Comment on attachment 8852619 [details] [diff] [review]
> Switch libpref over to ArenaAllocator
>
> Review of attachment 8852619 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: modules/libpref/prefapi.cpp
> @@ +66,5 @@
> > return (strcmp(prefEntry->key, otherKey) == 0);
> > }
> >
> > PLDHashTable* gHashTable;
> > +static ArenaAllocator<8192,4> gPrefNameArena;
>
> I'm not super-excited about the static constructor this is going to add.
> Maybe we can make the ArenaAllocator constructor constexpr to avoid that?
I'll make it constexpr in the blocking bug.
> Or, alternatively, we could have:
>
> struct GlobalPrefState
> {
> // Add the obvious constructor, etc.
> PLDHashTable mHashTable;
> ArenaAllocator<...> mPrefNameArena;
> };
>
> static GlobalPrefState* gState;
>
> and use that everywhere?
That sounds like more hassle than it's worth :)
| Assignee | ||
Comment 4•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c788438e745ec9663a9e29ae37a3197995669431
Bug 1351804 - Switch libpref over to ArenaAllocator. r=froydnj
Comment 5•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•