Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: chrome/browser/memory_purger.cc

Issue 10239012: Route calls to tcmalloc MallocExtension through allocator agnostic interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: separate allocator_extension into own static library, add comments to allocator_extension.h Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/memory_purger.cc
diff --git a/chrome/browser/memory_purger.cc b/chrome/browser/memory_purger.cc
index 7c2fd9e0154d4cfb13048e04382ed810244f7409..ecff13ef92a47b9ddc82b9ec8de9377d69fc49dd 100644
--- a/chrome/browser/memory_purger.cc
+++ b/chrome/browser/memory_purger.cc
@@ -6,6 +6,7 @@
#include <set>
+#include "base/allocator/allocator_extension.h"
#include "base/bind.h"
#include "base/threading/thread.h"
#include "chrome/browser/browser_process.h"
@@ -22,7 +23,6 @@
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
-#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
using content::BrowserContext;
using content::BrowserThread;
@@ -127,14 +127,12 @@ void MemoryPurger::PurgeBrowser() {
// * Purge AppCache memory. Not yet implemented sufficiently.
// * Browser-side DatabaseTracker. Not implemented sufficiently.
-#if !defined(OS_MACOSX) && defined(USE_TCMALLOC)
- // Tell tcmalloc to release any free pages it's still holding.
+ // Tell our allocator to release any free pages it's still holding.
//
// TODO(pkasting): A lot of the above calls kick off actions on other threads.
// Maybe we should find a way to avoid calling this until those actions
// complete?
- MallocExtension::instance()->ReleaseFreeMemory();
-#endif
+ base::allocator::ReleaseFreeMemory();
}
// static

Powered by Google App Engine
This is Rietveld 408576698