Bug 820128 - Use moz_malloc_size_of to measure "images-content-used-uncompressed". r+a=jlebar
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 18 Dec 2012 14:50:59 -0800
changeset 123057 22b738bec2fd12dcca952b48e60a5536639597d1
parent 123056 f8b55879b2dec28cec0104887c6be2ea96293220
child 123058 8e0337f05bbf6fcea2bebc956203f1001b66d25c
push id273
push userlsblakk@mozilla.com
push dateThu, 14 Feb 2013 23:19:38 +0000
treeherdermozilla-release@c5e807a3f8b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs820128
milestone19.0a2
Bug 820128 - Use moz_malloc_size_of to measure "images-content-used-uncompressed". r+a=jlebar
image/src/imgLoader.cpp
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -244,17 +244,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;
   }
 };