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

Unified Diff: base/allocator/allocator_shim_default_dispatch_to_glibc.cc

Issue 2697123007: base: Add support for malloc zones to the allocator shim (Closed)
Patch Set: Windows compile error. Created 3 years, 10 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_shim_default_dispatch_to_glibc.cc
diff --git a/base/allocator/allocator_shim_default_dispatch_to_glibc.cc b/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
index 7415ec60c01b69ea5cc4645b5f44259a5d56e687..8574da3eb3d011f08625f1e11cbeb1b0b5729965 100644
--- a/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+++ b/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
@@ -22,27 +22,38 @@ namespace {
using base::allocator::AllocatorDispatch;
-void* GlibcMalloc(const AllocatorDispatch*, size_t size) {
+void* GlibcMalloc(const AllocatorDispatch*, size_t size, void* context) {
return __libc_malloc(size);
}
-void* GlibcCalloc(const AllocatorDispatch*, size_t n, size_t size) {
+void* GlibcCalloc(const AllocatorDispatch*,
+ size_t n,
+ size_t size,
+ void* context) {
return __libc_calloc(n, size);
}
-void* GlibcRealloc(const AllocatorDispatch*, void* address, size_t size) {
+void* GlibcRealloc(const AllocatorDispatch*,
+ void* address,
+ size_t size,
+ void* context) {
return __libc_realloc(address, size);
}
-void* GlibcMemalign(const AllocatorDispatch*, size_t alignment, size_t size) {
+void* GlibcMemalign(const AllocatorDispatch*,
+ size_t alignment,
+ size_t size,
+ void* context) {
return __libc_memalign(alignment, size);
}
-void GlibcFree(const AllocatorDispatch*, void* address) {
+void GlibcFree(const AllocatorDispatch*, void* address, void* context) {
__libc_free(address);
}
-size_t GlibcGetSizeEstimate(const AllocatorDispatch*, void* address) {
+size_t GlibcGetSizeEstimate(const AllocatorDispatch*,
+ void* address,
+ void* context) {
// TODO(siggi, primiano): malloc_usable_size may need redirection in the
// presence of interposing shims that divert allocations.
return malloc_usable_size(address);

Powered by Google App Engine
This is Rietveld 408576698