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

Unified Diff: base/allocator/allocator_extension.cc

Issue 10823205: Report memory retained by memory allocator internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace GetProperty with GetAllocatorWasteSize Created 8 years, 2 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: base/allocator/allocator_extension.cc
diff --git a/base/allocator/allocator_extension.cc b/base/allocator/allocator_extension.cc
index d4ed6d72f2768f7001f1dbe30c6b2df780d24e6e..fb54ac556c032daa5be60954a9dc56e20233247e 100644
--- a/base/allocator/allocator_extension.cc
+++ b/base/allocator/allocator_extension.cc
@@ -9,10 +9,11 @@
namespace base {
namespace allocator {
-bool GetProperty(const char* name, size_t* value) {
- thunks::GetPropertyFunction get_property_function =
- base::allocator::thunks::GetGetPropertyFunction();
- return get_property_function != NULL && get_property_function(name, value);
+bool GetAllocatorWasteSize(size_t* size) {
+ thunks::GetAllocatorWasteSizeFunction get_allocator_waste_size_function =
+ base::allocator::thunks::GetGetAllocatorWasteSizeFunction();
darin (slow to review) 2012/10/23 17:28:30 nit: no need for base::allocator:: prefix when you
alexeif 2012/10/23 18:00:15 Done.
+ return get_allocator_waste_size_function != NULL &&
+ get_allocator_waste_size_function(size);
}
void GetStats(char* buffer, int buffer_length) {
@@ -32,11 +33,12 @@ void ReleaseFreeMemory() {
release_free_memory_function();
}
-void SetGetPropertyFunction(
- thunks::GetPropertyFunction get_property_function) {
- DCHECK_EQ(base::allocator::thunks::GetGetPropertyFunction(),
- reinterpret_cast<thunks::GetPropertyFunction>(NULL));
- base::allocator::thunks::SetGetPropertyFunction(get_property_function);
+void SetGetAllocatorWasteSizeFunction(
+ thunks::GetAllocatorWasteSizeFunction get_allocator_waste_size_function) {
+ DCHECK_EQ(base::allocator::thunks::GetGetAllocatorWasteSizeFunction(),
+ reinterpret_cast<thunks::GetAllocatorWasteSizeFunction>(NULL));
+ base::allocator::thunks::SetGetAllocatorWasteSizeFunction(
darin (slow to review) 2012/10/23 17:28:30 ditto: no need for base::allocator::
alexeif 2012/10/23 18:00:15 Done.
+ get_allocator_waste_size_function);
}
void SetGetStatsFunction(thunks::GetStatsFunction get_stats_function) {

Powered by Google App Engine
This is Rietveld 408576698