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

Unified Diff: base/allocator/allocator_shim.h

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
« no previous file with comments | « no previous file | base/allocator/allocator_shim.cc » ('j') | base/allocator/allocator_shim.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_shim.h
diff --git a/base/allocator/allocator_shim.h b/base/allocator/allocator_shim.h
index f43ec299d3cfc868b8def2fcd55be6db7342c77e..65ac1eb7de6c3f0b366ddc3832c6abed58c1c46d 100644
--- a/base/allocator/allocator_shim.h
+++ b/base/allocator/allocator_shim.h
@@ -46,33 +46,44 @@ namespace allocator {
// wihout introducing unnecessary perf hits.
struct AllocatorDispatch {
- using AllocFn = void*(const AllocatorDispatch* self, size_t size);
+ using AllocFn = void*(const AllocatorDispatch* self,
+ size_t size,
+ void* context);
using AllocZeroInitializedFn = void*(const AllocatorDispatch* self,
size_t n,
- size_t size);
+ size_t size,
+ void* context);
using AllocAlignedFn = void*(const AllocatorDispatch* self,
size_t alignment,
- size_t size);
+ size_t size,
+ void* context);
using ReallocFn = void*(const AllocatorDispatch* self,
void* address,
- size_t size);
- using FreeFn = void(const AllocatorDispatch* self, void* address);
+ size_t size,
+ void* context);
+ using FreeFn = void(const AllocatorDispatch* self,
+ void* address,
+ void* context);
// Returns the best available estimate for the actual amount of memory
// consumed by the allocation |address|. If possible, this should include
// heap overhead or at least a decent estimate of the full cost of the
// allocation. If no good estimate is possible, returns zero.
using GetSizeEstimateFn = size_t(const AllocatorDispatch* self,
- void* address);
+ void* address,
+ void* context);
using BatchMallocFn = unsigned(const AllocatorDispatch* self,
size_t size,
void** results,
- unsigned num_requested);
+ unsigned num_requested,
+ void* context);
using BatchFreeFn = void(const AllocatorDispatch* self,
void** to_be_freed,
- unsigned num_to_be_freed);
+ unsigned num_to_be_freed,
+ void* context);
using FreeDefiniteSizeFn = void(const AllocatorDispatch* self,
void* ptr,
- size_t size);
+ size_t size,
+ void* context);
AllocFn* const alloc_function;
AllocZeroInitializedFn* const alloc_zero_initialized_function;
« no previous file with comments | « no previous file | base/allocator/allocator_shim.cc » ('j') | base/allocator/allocator_shim.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698