Closed Bug 1417746 Opened 2 years ago Closed 2 years ago

Overhaul libpref's memory reporter

Categories

(Core :: Preferences: Backend, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: njn, Assigned: njn)

References

Details

Attachments

(1 file)

Because it currently doesn't measure some things it should, and it reports a single measurement for everything.
Comment on attachment 8928788 [details]
Bug 1417746 - Overhaul libpref's memory reporter.

https://reviewboard.mozilla.org/r/200052/#review205234

::: modules/libpref/Preferences.cpp:3417
(Diff revision 1)
> -    n += aMallocSizeOf(node);
> -    n += aMallocSizeOf(node->mDomain);
> -  }
>  
> -  return n;
> +  aSizes.mRootBranches +=
> +    static_cast<nsPrefBranch*>(sPreferences->mRootBranch.get())

Note, in a followup, I think you could change m*RootBranch to be nsCOMPtr<nsPrefBranch> instead of nsCOMPtr<nsIPrefBranch>, and that should simplify some things like this.
Attachment #8928788 - Flags: review?(mh+mozilla) → review+
> Note, in a followup, I think you could change m*RootBranch to be
> nsCOMPtr<nsPrefBranch> instead of nsCOMPtr<nsIPrefBranch>, and that should
> simplify some things like this.

I tried that a while ago... IIRC it required moving nsPrefBranch from Preferences.cpp to Preferences.h, which I didn't want to do.
https://hg.mozilla.org/mozilla-central/rev/3fa17ac9d0ee
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Assignee: nobody → n.nethercote
You need to log in before you can comment on or make changes to this bug.