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

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: Removing DCHECK. Created 8 years 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
« no previous file with comments | « base/allocator/allocator_extension.h ('k') | base/allocator/allocator_extension_thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_extension.cc
diff --git a/base/allocator/allocator_extension.cc b/base/allocator/allocator_extension.cc
index d4ed6d72f2768f7001f1dbe30c6b2df780d24e6e..83e460ac82bc899317b0634ac3a24afbcdb44cbc 100644
--- a/base/allocator/allocator_extension.cc
+++ b/base/allocator/allocator_extension.cc
@@ -9,16 +9,16 @@
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 =
+ thunks::GetGetAllocatorWasteSizeFunction();
+ return get_allocator_waste_size_function != NULL &&
+ get_allocator_waste_size_function(size);
}
void GetStats(char* buffer, int buffer_length) {
DCHECK_GT(buffer_length, 0);
- thunks::GetStatsFunction get_stats_function =
- base::allocator::thunks::GetGetStatsFunction();
+ thunks::GetStatsFunction get_stats_function = thunks::GetGetStatsFunction();
if (get_stats_function)
get_stats_function(buffer, buffer_length);
else
@@ -27,30 +27,29 @@ void GetStats(char* buffer, int buffer_length) {
void ReleaseFreeMemory() {
thunks::ReleaseFreeMemoryFunction release_free_memory_function =
- base::allocator::thunks::GetReleaseFreeMemoryFunction();
+ thunks::GetReleaseFreeMemoryFunction();
if (release_free_memory_function)
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(thunks::GetGetAllocatorWasteSizeFunction(),
+ reinterpret_cast<thunks::GetAllocatorWasteSizeFunction>(NULL));
+ thunks::SetGetAllocatorWasteSizeFunction(get_allocator_waste_size_function);
}
void SetGetStatsFunction(thunks::GetStatsFunction get_stats_function) {
- DCHECK_EQ(base::allocator::thunks::GetGetStatsFunction(),
+ DCHECK_EQ(thunks::GetGetStatsFunction(),
reinterpret_cast<thunks::GetStatsFunction>(NULL));
- base::allocator::thunks::SetGetStatsFunction(get_stats_function);
+ thunks::SetGetStatsFunction(get_stats_function);
}
void SetReleaseFreeMemoryFunction(
thunks::ReleaseFreeMemoryFunction release_free_memory_function) {
- DCHECK_EQ(base::allocator::thunks::GetReleaseFreeMemoryFunction(),
+ DCHECK_EQ(thunks::GetReleaseFreeMemoryFunction(),
reinterpret_cast<thunks::ReleaseFreeMemoryFunction>(NULL));
- base::allocator::thunks::SetReleaseFreeMemoryFunction(
- release_free_memory_function);
+ thunks::SetReleaseFreeMemoryFunction(release_free_memory_function);
}
} // namespace allocator
« no previous file with comments | « base/allocator/allocator_extension.h ('k') | base/allocator/allocator_extension_thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698