Permalink
Browse files

Bug 819819 (part 2) - Remove |name| from NS_MEMORY_REPORTER_MALLOC_SI…

…ZEOF_FUN. r=jlebar.

--HG--
rename : dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html => dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing.html
rename : toolkit/components/places/tests/browser/browser_favicon_privatebrowsing_perwindowpb.js => toolkit/components/places/tests/browser/browser_favicon_privatebrowsing.js
extra : rebase_source : 557cc60522970ce7eea3b006d357284d9b4694c4
  • Loading branch information...
1 parent 7e04c56 commit 330e9ff17a4fe9c34645bd4f6fd0ed6de3c36c20 @nnethercote nnethercote committed Dec 24, 2012
@@ -615,8 +615,7 @@ nsDOMMemoryFile::DataOwner::sDataOwners;
/* static */ bool
nsDOMMemoryFile::DataOwner::sMemoryReporterRegistered;
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(DOMMemoryFileDataOwnerSizeOf,
- "memory-file-data");
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(DOMMemoryFileDataOwnerMallocSizeOf)
class nsDOMMemoryFileDataOwnerMemoryReporter MOZ_FINAL
: public nsIMemoryMultiReporter
@@ -651,7 +650,7 @@ class nsDOMMemoryFileDataOwnerMemoryReporter MOZ_FINAL
for (DataOwner *owner = DataOwner::sDataOwners->getFirst();
owner; owner = owner->getNext()) {
- size_t size = DOMMemoryFileDataOwnerSizeOf(owner->mData);
+ size_t size = DOMMemoryFileDataOwnerMallocSizeOf(owner->mData);
if (size < LARGE_OBJECT_MIN_SIZE) {
smallObjectsTotal += size;
@@ -140,7 +140,7 @@ WebGLMemoryMultiReporterWrapper::~WebGLMemoryMultiReporterWrapper()
NS_UnregisterMemoryMultiReporter(mReporter);
}
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(WebGLBufferMallocSizeOfFun, "webgl-buffer")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(WebGLBufferMallocSizeOf)
int64_t
WebGLMemoryMultiReporterWrapper::GetBufferCacheMemoryUsed() {
@@ -152,13 +152,13 @@ WebGLMemoryMultiReporterWrapper::GetBufferCacheMemoryUsed() {
buffer = buffer->getNext())
{
if (buffer->Target() == LOCAL_GL_ELEMENT_ARRAY_BUFFER)
- result += buffer->SizeOfIncludingThis(WebGLBufferMallocSizeOfFun);
+ result += buffer->SizeOfIncludingThis(WebGLBufferMallocSizeOf);
}
}
return result;
}
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(WebGLShaderMallocSizeOfFun, "webgl-shader")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(WebGLShaderMallocSizeOf)
int64_t
WebGLMemoryMultiReporterWrapper::GetShaderSize() {
@@ -169,7 +169,7 @@ WebGLMemoryMultiReporterWrapper::GetShaderSize() {
shader;
shader = shader->getNext())
{
- result += shader->SizeOfIncludingThis(WebGLShaderMallocSizeOfFun);
+ result += shader->SizeOfIncludingThis(WebGLShaderMallocSizeOf);
}
}
return result;
@@ -177,8 +177,7 @@ static nsJSContext *sContextList = nullptr;
static nsScriptNameSpaceManager *gNameSpaceManager;
static nsIMemoryReporter *gReporter;
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(ScriptNameSpaceManagerMallocSizeOf,
- "script-namespace-manager")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(ScriptNameSpaceManagerMallocSizeOf)
static int64_t
GetScriptNameSpaceManagerSize()
@@ -105,7 +105,7 @@ AppendWindowURI(nsGlobalWindow *aWindow, nsACString& aStr)
}
}
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(DOMStyleMallocSizeOf, "windows")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(WindowsMallocSizeOf)
// The key is the window ID.
typedef nsDataHashtable<nsUint64HashKey, nsCString> WindowPaths;
@@ -166,7 +166,7 @@ CollectWindowReports(nsGlobalWindow *aWindow,
} \
} while (0)
- nsWindowSizes windowSizes(DOMStyleMallocSizeOf);
+ nsWindowSizes windowSizes(WindowsMallocSizeOf);
aWindow->SizeOfIncludingThis(&windowSizes);
REPORT("/dom/other", windowSizes.mDOMOther,
@@ -80,7 +80,7 @@ USING_WORKERS_NAMESPACE
using namespace mozilla::dom::workers::events;
using namespace mozilla::dom;
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(JsWorkerMallocSizeOf, "js-worker")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(JsWorkerMallocSizeOf)
namespace {
@@ -98,7 +98,7 @@ NS_IMPL_CYCLE_COLLECTION_3(mozHunspell,
// Memory reporting stuff.
static int64_t gHunspellAllocatedSize = 0;
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(HunspellMallocSizeOfOnAlloc, "hunspell")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(HunspellMallocSizeOfOnAlloc)
NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_FREE_FUN(HunspellMallocSizeOfOnFree)
void HunspellReportMemoryAllocation(void* ptr) {
@@ -46,7 +46,7 @@ NS_MEMORY_REPORTER_IMPLEMENT(Freetype,
"Memory used by Freetype."
)
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(FreetypeMallocSizeOfOnAlloc, "freetype")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(FreetypeMallocSizeOfOnAlloc)
NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_FREE_FUN(FreetypeMallocSizeOfOnFree)
static void*
View
@@ -1129,7 +1129,7 @@ gfxFontFamily::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
NS_IMPL_ISUPPORTS1(gfxFontCache::MemoryReporter, nsIMemoryMultiReporter)
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(FontCacheMallocSizeOf, "font-cache")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(FontCacheMallocSizeOf)
NS_IMETHODIMP
gfxFontCache::MemoryReporter::GetName(nsACString &aName)
@@ -72,7 +72,7 @@ gfxFontListPrefObserver::Observe(nsISupports *aSubject,
NS_IMPL_ISUPPORTS1(gfxPlatformFontList::MemoryReporter, nsIMemoryMultiReporter)
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(FontListMallocSizeOf, "font-list")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(FontListMallocSizeOf)
NS_IMETHODIMP
gfxPlatformFontList::MemoryReporter::GetName(nsACString &aName)
View
@@ -64,7 +64,7 @@
using namespace mozilla;
using namespace mozilla::image;
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(ImagesMallocSizeOf, "images")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(ImagesMallocSizeOf)
class imgMemoryReporter MOZ_FINAL :
public nsIMemoryMultiReporter
@@ -1482,7 +1482,7 @@ NS_MEMORY_REPORTER_IMPLEMENT(XPConnectJSUserCompartmentCount,
rtTotal += amount; \
} while (0)
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(JsMallocSizeOf, "js")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(JsMallocSizeOf)
namespace xpc {
@@ -1979,16 +1979,16 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(JSCompartmentsMultiReporter
, nsIMemoryMultiReporter
)
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(OrphanSizeOf, "orphans")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(OrphanMallocSizeOf)
namespace xpc {
static size_t
SizeOfTreeIncludingThis(nsINode *tree)
{
- size_t n = tree->SizeOfIncludingThis(OrphanSizeOf);
+ size_t n = tree->SizeOfIncludingThis(OrphanMallocSizeOf);
for (nsIContent* child = tree->GetFirstChild(); child; child = child->GetNextNode(tree)) {
- n += child->SizeOfIncludingThis(OrphanSizeOf);
+ n += child->SizeOfIncludingThis(OrphanMallocSizeOf);
}
return n;
}
@@ -21,8 +21,7 @@
#include "nsLayoutStatics.h"
#include "nsIMemoryReporter.h"
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(LayoutStyleSheetServiceMallocSizeOf,
- "layout/style-sheet-service")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(LayoutStyleSheetServiceMallocSizeOf)
static int64_t
GetStyleSheetServiceSize()
@@ -16,8 +16,7 @@
#include "nsIXULRuntime.h"
#include "nsCSSStyleSheet.h"
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(LayoutStyleSheetCacheMallocSizeOf,
- "layout/style-sheet-cache")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(LayoutStyleSheetCacheMallocSizeOf)
static int64_t
GetStylesheetCacheSize()
@@ -158,7 +158,7 @@ static nsTArray<nsAutoPtr<CacheData> >* gCacheData = nullptr;
static nsRefPtrHashtable<ValueObserverHashKey,
ValueObserver>* gObserverTable = nullptr;
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(PreferencesMallocSizeOf, "preferences")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(PreferencesMallocSizeOf)
static size_t
SizeOfObserverEntryExcludingThis(ValueObserverHashKey* aKey,
@@ -1080,7 +1080,7 @@ NS_THREADSAFE_MEMORY_REPORTER_IMPLEMENT(NetworkMemoryCache,
nsCacheService::MemoryDeviceSize,
"Memory used by the network memory cache.")
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(NetworkDiskCacheSizeOfFun, "network-disk-cache")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(NetworkDiskCacheMallocSizeOf)
static nsCOMPtr<nsIMemoryReporter> DiskCacheReporter = nullptr;
@@ -2288,7 +2288,7 @@ nsCacheService::DiskDeviceHeapSize()
{
nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHESERVICE_DISKDEVICEHEAPSIZE));
nsDiskCacheDevice *diskDevice = GlobalInstance()->mDiskDevice;
- return (int64_t)(diskDevice ? diskDevice->SizeOfIncludingThis(NetworkDiskCacheSizeOfFun) : 0);
+ return (int64_t)(diskDevice ? diskDevice->SizeOfIncludingThis(NetworkDiskCacheMallocSizeOf) : 0);
}
nsresult
@@ -59,8 +59,7 @@ nsDomainEntry::FuncForStaticAsserts(void)
static nsEffectiveTLDService *gService = nullptr;
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(EffectiveTLDServiceMallocSizeOf,
- "effective-tld-service")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(EffectiveTLDServiceMallocSizeOf)
static int64_t
GetEffectiveTLDSize()
@@ -66,7 +66,7 @@ NS_MEMORY_REPORTER_IMPLEMENT(StartupCacheMapping,
"Memory used to hold the mapping of the startup cache from file. This "
"memory is likely to be swapped out shortly after start-up.")
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(StartupCacheDataMallocSizeOf, "startup-cache/data")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(StartupCacheDataMallocSizeOf)
static int64_t
GetStartupCacheDataSize()
@@ -470,38 +470,38 @@ namespace {
// sqlite is fully and correctly accounting for all of its heap blocks via its
// own memory accounting.
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(sqliteMallocSizeOfOnAlloc, "sqlite")
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_FREE_FUN(sqliteMallocSizeOfOnFree)
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(SqliteMallocSizeOfOnAlloc)
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_FREE_FUN(SqliteMallocSizeOfOnFree)
#endif
static void *sqliteMemMalloc(int n)
{
void* p = ::moz_malloc(n);
#ifdef MOZ_DMD
- sqliteMallocSizeOfOnAlloc(p);
+ SqliteMallocSizeOfOnAlloc(p);
#endif
return p;
}
static void sqliteMemFree(void *p)
{
#ifdef MOZ_DMD
- sqliteMallocSizeOfOnFree(p);
+ SqliteMallocSizeOfOnFree(p);
#endif
::moz_free(p);
}
static void *sqliteMemRealloc(void *p, int n)
{
#ifdef MOZ_DMD
- sqliteMallocSizeOfOnFree(p);
+ SqliteMallocSizeOfOnFree(p);
void *pnew = ::moz_realloc(p, n);
if (pnew) {
- sqliteMallocSizeOfOnAlloc(pnew);
+ SqliteMallocSizeOfOnAlloc(pnew);
} else {
- // realloc failed; undo the sqliteMallocSizeOfOnFree from above
- sqliteMallocSizeOfOnAlloc(p);
+ // realloc failed; undo the SqliteMallocSizeOfOnFree from above
+ SqliteMallocSizeOfOnAlloc(p);
}
return pnew;
#else
@@ -1402,8 +1402,7 @@ StoreAndNotifyEmbedVisit(VisitData& aPlace,
(void)NS_DispatchToMainThread(event);
}
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(HistoryLinksHashtableMallocSizeOf,
- "history-links-hashtable")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(HistoryLinksHashtableMallocSizeOf)
int64_t GetHistoryObserversSize()
{
@@ -329,7 +329,7 @@ class TelemetryImpl MOZ_FINAL : public nsITelemetry
TelemetryImpl* TelemetryImpl::sTelemetry = NULL;
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(TelemetryMallocSizeOf, "telemetry")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(TelemetryMallocSizeOf)
size_t
TelemetryImpl::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
@@ -49,8 +49,7 @@ class nsPrefixSetReporter : public nsIMemoryReporter
NS_IMPL_THREADSAFE_ISUPPORTS1(nsPrefixSetReporter, nsIMemoryReporter)
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(StoragePrefixSetMallocSizeOf,
- "storage/prefixset")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(StoragePrefixSetMallocSizeOf)
nsPrefixSetReporter::nsPrefixSetReporter(nsUrlClassifierPrefixSet* aParent,
const nsACString& aName)
@@ -3026,8 +3026,7 @@ nsCycleCollector::WasFreed(nsISupports *n)
// Memory reporter
////////////////////////
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(CycleCollectorMallocSizeOf,
- "cycle-collector")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(CycleCollectorMallocSizeOf)
void
nsCycleCollector::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
@@ -376,46 +376,44 @@ void RunReporters();
#include "DMD.h"
-#define MOZ_REPORT(ptr, usable, name) mozilla::dmd::Report(ptr)
-#define MOZ_REPORT_ON_ALLOC(ptr, usable, name) mozilla::dmd::ReportOnAlloc(ptr)
+#define MOZ_REPORT(ptr) mozilla::dmd::Report(ptr)
+#define MOZ_REPORT_ON_ALLOC(ptr) mozilla::dmd::ReportOnAlloc(ptr)
#else
-#define MOZ_REPORT(ptr, usable, name)
-#define MOZ_REPORT_ON_ALLOC(ptr, usable, name)
+#define MOZ_REPORT(ptr)
+#define MOZ_REPORT_ON_ALLOC(ptr)
#endif // defined(MOZ_DMD)
// Functions generated via this macro should be used by all traversal-based
// memory reporters. Such functions return |moz_malloc_size_of(ptr)|; this
// will always be zero on some obscure platforms.
//
-// You might be wondering why we have a macro that creates multiple
-// functions distinguished only by |name|, instead of a single
+// You might be wondering why we have a macro that creates multiple functions
+// that differ only in their name, instead of a single
// MemoryReporterMallocSizeOf function. It's mostly to help with DMD
-// integration, though it sometimes also helps with debugging and temporary
-// ad hoc profiling. The |name| chosen doesn't matter greatly, but it's
+// integration, though it sometimes also helps with debugging and temporary ad
+// hoc profiling. The function name chosen doesn't matter greatly, but it's
// best to make it similar to the path used by the relevant memory
// reporter(s).
-#define NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(fn, name) \
+#define NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(fn) \
static size_t fn(const void *ptr) \
{ \
- size_t usable = moz_malloc_size_of(ptr); \
- MOZ_REPORT(ptr, usable, name); \
- return usable; \
+ MOZ_REPORT(ptr); \
+ return moz_malloc_size_of(ptr); \
}
// Functions generated by the next two macros should be used by wrapping
// allocators that report heap blocks as soon as they are allocated and
// unreport them as soon as they are freed. Such allocators are used in cases
// where we have third-party code that we cannot modify. The two functions
// must always be used in tandem.
-#define NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(fn, name) \
+#define NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(fn) \
static size_t fn(const void *ptr) \
{ \
- size_t usable = moz_malloc_size_of(ptr); \
- MOZ_REPORT_ON_ALLOC(ptr, usable, name); \
- return usable; \
+ MOZ_REPORT_ON_ALLOC(ptr); \
+ return moz_malloc_size_of(ptr); \
}
#define NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_FREE_FUN(fn) \
static size_t fn(const void *ptr) \
@@ -543,7 +543,7 @@ NS_FALLIBLE_MEMORY_REPORTER_IMPLEMENT(Explicit,
"different results.")
#endif // HAVE_JEMALLOC_STATS
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(AtomTableMallocSizeOf, "atom-table")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(AtomTableMallocSizeOf)
static int64_t GetAtomTableSize() {
return NS_SizeOfAtomTablesIncludingThis(AtomTableMallocSizeOf);
@@ -401,8 +401,7 @@ CategoryEnumerator::enumfunc_createenumerator(const char* aStr, CategoryNode* aN
NS_IMPL_QUERY_INTERFACE1(nsCategoryManager, nsICategoryManager)
-NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(CategoryManagerMallocSizeOf,
- "category-manager")
+NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(CategoryManagerMallocSizeOf)
NS_MEMORY_REPORTER_IMPLEMENT(CategoryManager,
"explicit/xpcom/category-manager",
Oops, something went wrong.

0 comments on commit 330e9ff

Please sign in to comment.