Bug 693976 - Don't parse /proc/self/maps once for every entry in /proc/self/smaps. r=khuey

This commit is contained in:
Justin Lebar 2011-10-14 15:05:52 -04:00
Родитель 06ff2a9e4c
Коммит 2d4b7da9cd
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -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.