author | Justin Lebar <justin.lebar@gmail.com> |
Fri, 09 Mar 2012 18:15:54 -0500 | |
changeset 91942 | 55e63a03ccad43dcd2395c52035d066d939a6d86 |
parent 91941 | afa931630210ef87b92c4e8ee9769052394a5094 |
child 91943 | 1fa083bd043407162a6d67bd671a109bcbf5c825 |
push id | 136 |
push user | lsblakk@mozilla.com |
push date | Fri, 01 Jun 2012 02:39:32 +0000 |
treeherder | mozilla-release@7ebf7352c959 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 732820 |
milestone | 13.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
|
image/src/DiscardTracker.cpp | file | annotate | diff | comparison | revisions | |
image/src/DiscardTracker.h | file | annotate | diff | comparison | revisions |
--- a/image/src/DiscardTracker.cpp +++ b/image/src/DiscardTracker.cpp @@ -14,17 +14,17 @@ namespace image { static const char* sDiscardTimeoutPref = "image.mem.min_discard_timeout_ms"; /* static */ LinkedList<DiscardTracker::Node> DiscardTracker::sDiscardableImages; /* static */ nsCOMPtr<nsITimer> DiscardTracker::sTimer; /* static */ bool DiscardTracker::sInitialized = false; /* static */ bool DiscardTracker::sTimerOn = false; /* static */ bool DiscardTracker::sDiscardRunnablePending = false; -/* static */ ssize_t DiscardTracker::sCurrentDecodedImageBytes = 0; +/* static */ PRUint64 DiscardTracker::sCurrentDecodedImageBytes = 0; /* static */ PRUint32 DiscardTracker::sMinDiscardTimeoutMs = 10000; /* static */ PRUint32 DiscardTracker::sMaxDecodedImageKB = 42 * 1024; /* * When we notice we're using too much memory for decoded images, we enqueue a * DiscardRunnable, which runs this code. */ NS_IMETHODIMP @@ -114,17 +114,17 @@ DiscardTracker::DiscardAll() sDiscardableImages.clear(); // The list is empty, so there's no need to leave the timer on. DisableTimer(); } void -DiscardTracker::InformAllocation(ssize_t bytes) +DiscardTracker::InformAllocation(PRUint64 bytes) { // This function is called back e.g. from RasterImage::Discard(); be careful! sCurrentDecodedImageBytes += bytes; MOZ_ASSERT(sCurrentDecodedImageBytes >= 0); // If we're using too much memory for decoded images, MaybeDiscardSoon will // enqueue a callback to discard some images.
--- a/image/src/DiscardTracker.h +++ b/image/src/DiscardTracker.h @@ -70,17 +70,17 @@ class DiscardTracker */ static void DiscardAll(); /** * Inform the discard tracker that we've allocated or deallocated some * memory for a decoded image. We use this to determine when we've * allocated too much memory and should discard some images. */ - static void InformAllocation(ssize_t bytes); + static void InformAllocation(PRUint64 bytes); private: /** * This is called when the discard timer fires; it calls into DiscardNow(). */ friend int DiscardTimeoutChangedCallback(const char* aPref, void *aClosure); /** @@ -100,17 +100,17 @@ class DiscardTracker static void TimerCallback(nsITimer *aTimer, void *aClosure); static void DiscardNow(); static LinkedList<Node> sDiscardableImages; static nsCOMPtr<nsITimer> sTimer; static bool sInitialized; static bool sTimerOn; static bool sDiscardRunnablePending; - static ssize_t sCurrentDecodedImageBytes; + static PRUint64 sCurrentDecodedImageBytes; static PRUint32 sMinDiscardTimeoutMs; static PRUint32 sMaxDecodedImageKB; }; } // namespace image } // namespace mozilla #endif /* mozilla_imagelib_DiscardTracker_h_ */