Bug 820128 - Use moz_malloc_size_of to measure "images-content-used-uncompressed". r=jlebar.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 18 Dec 2012 14:50:59 -0800
changeset 125666 d8ace39cb45fec87dfa88ebe8121acf930a6d2e1
parent 125665 70ded23485ab4e065d477677beb8b637c063b0f3
child 125667 a428738147c7dd24ec08bf899b69f48fc5812462
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlebar
bugs820128
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 820128 - Use moz_malloc_size_of to measure "images-content-used-uncompressed". r=jlebar.
image/src/imgLoader.cpp
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -245,17 +245,22 @@ private:
                                                    imgCacheEntry *entry,
                                                    void *userArg)
   {
     if (!entry->HasNoProxies()) {
       size_t *n = static_cast<size_t*>(userArg);
       nsRefPtr<imgRequest> req = entry->GetRequest();
       Image *image = static_cast<Image*>(req->mImage.get());
       if (image) {
-        *n += image->HeapSizeOfDecodedWithComputedFallback(ImagesMallocSizeOf);
+        // Both this and EntryAllSizes measure images-content-used-uncompressed
+        // memory.  This function's measurement is secondary -- the result
+        // doesn't go in the "explicit" tree -- so we use moz_malloc_size_of
+        // instead of ImagesMallocSizeOf to prevent DMD from seeing it reported
+        // twice.
+        *n += image->HeapSizeOfDecodedWithComputedFallback(moz_malloc_size_of);
         *n += image->NonHeapSizeOfDecoded();
       }
     }
 
     return PL_DHASH_NEXT;
   }
 };