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

Unified Diff: base/allocator/allocator_extension_thunks.h

Issue 1469843002: Remove dependency on allocator from 'content' targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unify_allocator1_2
Patch Set: Fix build Created 5 years, 1 month 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_thunks.h
diff --git a/base/allocator/allocator_extension_thunks.h b/base/allocator/allocator_extension_thunks.h
index f1b4a93649d3a1c8f6349a710a00da24ae4bc552..8d5abda64865195785c93d7b6fd6f5900ba0f48b 100644
--- a/base/allocator/allocator_extension_thunks.h
+++ b/base/allocator/allocator_extension_thunks.h
@@ -15,24 +15,36 @@ namespace thunks {
// new allocator extension from a specific allocator implementation to base.
// See allocator_extension.h to see the interface that base exports.
-typedef bool (*GetAllocatorWasteSizeFunction)(size_t* size);
-void SetGetAllocatorWasteSizeFunction(
- GetAllocatorWasteSizeFunction get_allocator_waste_size_function);
-GetAllocatorWasteSizeFunction GetGetAllocatorWasteSizeFunction();
-
-typedef void (*GetStatsFunction)(char* buffer, int buffer_length);
-void SetGetStatsFunction(GetStatsFunction get_stats_function);
-GetStatsFunction GetGetStatsFunction();
-
-typedef void (*ReleaseFreeMemoryFunction)();
-void SetReleaseFreeMemoryFunction(
- ReleaseFreeMemoryFunction release_free_memory_function);
-ReleaseFreeMemoryFunction GetReleaseFreeMemoryFunction();
-
-typedef bool (*GetNumericPropertyFunction)(const char* name, size_t* value);
-void SetGetNumericPropertyFunction(
- GetNumericPropertyFunction get_numeric_property_function);
-GetNumericPropertyFunction GetGetNumericPropertyFunction();
+// Pointers to all the allcator extension functions that are used in chrome.
+struct AllocatorExtensionFunctions {
+ typedef bool (*GetAllocatorWasteSize)(size_t* size);
+ typedef void (*GetStats)(char* buffer, int buffer_length);
+ typedef void (*ReleaseFreeMemory)();
+ typedef unsigned int (*GetBytesAllocatedOnCurrentThread)();
+ typedef bool (*GetNumericProperty)(const char* name, size_t* value);
+
+ typedef int (*StackGenerator)(int skip_count, void** stack);
+ typedef void (*HeapProfilerStart)(StackGenerator callback);
+ typedef void (*HeapProfilerStop)();
+ typedef char* (*GetHeapProfile)();
+ typedef void (*HeapProfilerDump)(const char* reason);
+ typedef bool (*IsHeapProfilerRunning)();
+
+ GetAllocatorWasteSize get_allocator_waste_size;
+ GetStats get_stats;
+ ReleaseFreeMemory release_free_memory;
+ GetBytesAllocatedOnCurrentThread get_bytes_allocated_on_current_thread;
+ GetNumericProperty get_numeric_property;
+
+ HeapProfilerStart heap_profiler_start;
+ HeapProfilerStop heap_profiler_stop;
+ GetHeapProfile get_heap_profile;
+ HeapProfilerDump heap_profiler_dump;
+ IsHeapProfilerRunning is_heap_profiler_running;
+};
+
+void SetAllocatorExtensionFunctions(AllocatorExtensionFunctions functions);
+AllocatorExtensionFunctions GetAllocatorExtensionFunctions();
} // namespace thunks
} // namespace allocator

Powered by Google App Engine
This is Rietveld 408576698