Bug 939385 (part 3) - Expose vsizeMaxContiguous to about:memory. r=froydnj.

--HG--
extra : rebase_source : 77331283b56ddf28a137a0165ef9926d6e0f0f42
This commit is contained in:
Nicholas Nethercote 2013-11-18 22:37:38 -08:00
parent ed562d6f23
commit 910c1214e3
2 changed files with 20 additions and 1 deletions

View File

@ -104,7 +104,8 @@
// If we have more than 1000 chars, we've probably successfully
// copy+pasted.
if (actual.length > 1000) {
let vsizes = actual.match(/vsize/g);
// Note: Match "vsize" but not "vsize-max-contiguous".
let vsizes = actual.match(/vsize[^-]/g);
let endOfBrowsers = actual.match(/End of Browser/g);
if (vsizes.length == 4 && endOfBrowsers.length == 3) {

View File

@ -399,6 +399,20 @@ static nsresult GetVsizeMaxContiguous(int64_t* aN)
return NS_OK;
}
class VsizeMaxContiguousReporter MOZ_FINAL : public MemoryUniReporter
{
public:
VsizeMaxContiguousReporter()
: MemoryUniReporter("vsize-max-contiguous", KIND_OTHER, UNITS_BYTES,
"Size of the maximum contiguous block of available virtual memory.")
{}
NS_IMETHOD GetAmount(int64_t* aAmount)
{
return GetVsizeMaxContiguous(aAmount);
}
};
#define HAVE_PRIVATE_REPORTER
class PrivateReporter MOZ_FINAL : public MemoryUniReporter
{
@ -776,6 +790,10 @@ nsMemoryReporterManager::Init()
RegisterReporter(new ResidentReporter);
#endif
#ifdef HAVE_VSIZE_MAX_CONTIGUOUS_REPORTER
RegisterReporter(new VsizeMaxContiguousReporter);
#endif
#ifdef HAVE_RESIDENT_UNIQUE_REPORTER
RegisterReporter(new ResidentUniqueReporter);
#endif