mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 693976 - Don't parse /proc/self/maps once for every entry in /proc/self/smaps. r=khuey
This commit is contained in:
parent
4426ead531
commit
c7fcd225c6
@ -175,6 +175,7 @@ private:
|
||||
nsISupports *aClosure,
|
||||
CategoriesSeen *aCategoriesSeen);
|
||||
|
||||
bool mSearchedForLibxul;
|
||||
nsCString mLibxulDir;
|
||||
nsCStringHashSet mMozillaLibraries;
|
||||
};
|
||||
@ -182,6 +183,7 @@ private:
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(MapsReporter, nsIMemoryMultiReporter)
|
||||
|
||||
MapsReporter::MapsReporter()
|
||||
: mSearchedForLibxul(false)
|
||||
{
|
||||
const PRUint32 len = NS_ARRAY_LENGTH(mozillaLibraries);
|
||||
mMozillaLibraries.Init(len);
|
||||
@ -233,6 +235,11 @@ MapsReporter::CollectReports(nsIMemoryMultiReporterCallback *aCallback,
|
||||
nsresult
|
||||
MapsReporter::FindLibxul()
|
||||
{
|
||||
if (mSearchedForLibxul)
|
||||
return NS_OK;
|
||||
|
||||
mSearchedForLibxul = true;
|
||||
|
||||
mLibxulDir.Truncate();
|
||||
|
||||
// Note that we're scanning /proc/self/*maps*, not smaps, here.
|
||||
|
Loading…
Reference in New Issue
Block a user