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

Unified Diff: base/allocator/allocator_shim_override_mac_symbols.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
Index: base/allocator/allocator_shim_override_mac_symbols.h
diff --git a/base/allocator/allocator_shim_override_mac_symbols.h b/base/allocator/allocator_shim_override_mac_symbols.h
index 5107d752f16a743cef11ee99019bf680a5330f81..5ae9b2a555830f1c58514a2269fd90d8830a5026 100644
--- a/base/allocator/allocator_shim_override_mac_symbols.h
+++ b/base/allocator/allocator_shim_override_mac_symbols.h
@@ -16,39 +16,41 @@ namespace allocator {
void OverrideMacSymbols() {
MallocZoneFunctions new_functions;
new_functions.size = [](malloc_zone_t* zone, const void* ptr) -> size_t {
- return ShimGetSizeEstimate(ptr);
+ return ShimGetSizeEstimate(ptr, zone);
};
new_functions.malloc = [](malloc_zone_t* zone, size_t size) -> void* {
- return ShimMalloc(size);
+ return ShimMalloc(size, zone);
};
new_functions.calloc = [](malloc_zone_t* zone, size_t n,
size_t size) -> void* {
- return ShimCalloc(n, size);
+ return ShimCalloc(n, size, zone);
};
new_functions.valloc = [](malloc_zone_t* zone, size_t size) -> void* {
- return ShimValloc(size);
+ return ShimValloc(size, zone);
+ };
+ new_functions.free = [](malloc_zone_t* zone, void* ptr) {
+ ShimFree(ptr, zone);
};
- new_functions.free = [](malloc_zone_t* zone, void* ptr) { ShimFree(ptr); };
new_functions.realloc = [](malloc_zone_t* zone, void* ptr,
size_t size) -> void* {
- return ShimRealloc(ptr, size);
+ return ShimRealloc(ptr, size, zone);
};
new_functions.batch_malloc = [](struct _malloc_zone_t* zone, size_t size,
void** results,
unsigned num_requested) -> unsigned {
- return ShimBatchMalloc(size, results, num_requested);
+ return ShimBatchMalloc(size, results, num_requested, zone);
};
new_functions.batch_free = [](struct _malloc_zone_t* zone, void** to_be_freed,
unsigned num_to_be_freed) -> void {
- ShimBatchFree(to_be_freed, num_to_be_freed);
+ ShimBatchFree(to_be_freed, num_to_be_freed, zone);
};
new_functions.memalign = [](malloc_zone_t* zone, size_t alignment,
size_t size) -> void* {
- return ShimMemalign(alignment, size);
+ return ShimMemalign(alignment, size, zone);
};
new_functions.free_definite_size = [](malloc_zone_t* zone, void* ptr,
size_t size) {
- ShimFreeDefiniteSize(ptr, size);
+ ShimFreeDefiniteSize(ptr, size, zone);
};
base::allocator::ReplaceFunctionsForDefaultZone(&new_functions);

Powered by Google App Engine
This is Rietveld 408576698