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

Unified Diff: base/allocator/allocator_extension.h

Issue 10825250: Expose memory allocator internal stats and properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add jemalloc.h include Created 8 years, 3 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
« no previous file with comments | « base/allocator/allocator.gyp ('k') | base/allocator/allocator_extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_extension.h
diff --git a/base/allocator/allocator_extension.h b/base/allocator/allocator_extension.h
index b71fffe421b40859dd5c90c2ee02e2bb0894f5aa..dda0fd9dcfb40f6c53783a6a952ec428c4e5ab06 100644
--- a/base/allocator/allocator_extension.h
+++ b/base/allocator/allocator_extension.h
@@ -5,6 +5,8 @@
#ifndef BASE_ALLOCATOR_ALLOCATOR_EXTENSION_H
#define BASE_ALLOCATOR_ALLOCATOR_EXTENSION_H
+#include <stddef.h> // for size_t
+
#include "base/allocator/allocator_extension_thunks.h"
#include "base/base_export.h"
#include "build/build_config.h"
@@ -12,6 +14,14 @@
namespace base {
namespace allocator {
+// Request the allocator to report value of its internal state variable.
+//
+// |name| name of the variable
+// |value| pointer to the returned value, must be not NULL.
+// Returns true if the value has been returned, false if a variable with such
+// name does not exist.
+BASE_EXPORT bool GetProperty(const char* name, size_t* value);
+
// Request that the allocator print a human-readable description of the current
// state of the allocator into a null-terminated string in the memory segment
// buffer[0,buffer_length-1].
@@ -33,11 +43,15 @@ BASE_EXPORT void ReleaseFreeMemory();
// No threading promises are made. The caller is responsible for making sure
// these pointers are set before any other threads attempt to call the above
// functions.
+BASE_EXPORT void SetGetPropertyFunction(
+ thunks::GetPropertyFunction get_property_function);
+
BASE_EXPORT void SetGetStatsFunction(
- thunks::GetStatsFunction* get_stats_function);
+ thunks::GetStatsFunction get_stats_function);
BASE_EXPORT void SetReleaseFreeMemoryFunction(
- thunks::ReleaseFreeMemoryFunction* release_free_memory_function);
+ thunks::ReleaseFreeMemoryFunction release_free_memory_function);
+
} // namespace allocator
} // namespace base
« no previous file with comments | « base/allocator/allocator.gyp ('k') | base/allocator/allocator_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698