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

Unified Diff: base/allocator/allocator_shim_override_mac_symbols.h

Issue 2727463002: mac: Several minor fixes to allocator shim. (Closed)
Patch Set: Treat MallocZoneFunctions as POD. 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 dceba48f6358582383e303fe81ab7b4629c39002..0b65edb154747e8dd0f5440fc434a23f36afa58c 100644
--- a/base/allocator/allocator_shim_override_mac_symbols.h
+++ b/base/allocator/allocator_shim_override_mac_symbols.h
@@ -7,15 +7,15 @@
#endif
#define BASE_ALLOCATOR_ALLOCATOR_SHIM_OVERRIDE_MAC_SYMBOLS_H_
-#include "base/allocator/allocator_interception_mac.h"
#include "base/allocator/malloc_zone_functions_mac.h"
#include "third_party/apple_apsl/malloc.h"
namespace base {
namespace allocator {
-void OverrideMacSymbols() {
+MallocZoneFunctions MallocZoneFunctionsToReplaceDefault() {
MallocZoneFunctions new_functions;
+ memset(&new_functions, 0, sizeof(MallocZoneFunctions));
new_functions.size = [](malloc_zone_t* zone, const void* ptr) -> size_t {
return ShimGetSizeEstimate(ptr, zone);
};
@@ -53,8 +53,7 @@ void OverrideMacSymbols() {
size_t size) {
ShimFreeDefiniteSize(ptr, size, zone);
};
-
- base::allocator::ReplaceFunctionsForStoredZones(&new_functions);
+ return new_functions;
}
} // namespace allocator

Powered by Google App Engine
This is Rietveld 408576698