зеркало из https://github.com/mozilla/gecko-dev.git
Bug 939385 (part 3, attempt 2) - Expose vsizeMaxContiguous to about:memory. r=froydnj.
--HG-- extra : rebase_source : 2a7dcf2121c323bb37094b23e329c322f25dfeeb
This commit is contained in:
Родитель
2e69b12e8d
Коммит
8a5c15606b
|
@ -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) {
|
||||
|
|
|
@ -400,6 +400,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
|
||||
{
|
||||
|
@ -778,6 +792,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
|
||||
|
|
Загрузка…
Ссылка в новой задаче