summaryrefslogtreecommitdiffstats
path: root/base/process_util_mac.mm
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-19 16:51:26 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-19 16:51:26 +0000
commit61cd1ab0f458f8cd18f74c56110c6a10bd938eed (patch)
tree976de5d7906efbf200d39e40d3c09e3d15a3f985 /base/process_util_mac.mm
parente57b0db08bc0f73d4f42f485ea1ed9070969c18f (diff)
downloadchromium_src-61cd1ab0f458f8cd18f74c56110c6a10bd938eed.zip
chromium_src-61cd1ab0f458f8cd18f74c56110c6a10bd938eed.tar.gz
chromium_src-61cd1ab0f458f8cd18f74c56110c6a10bd938eed.tar.bz2
Fix definition of CFAllocator (malloc_zone_t changed size between 10.5 and 10.6).
BUG=none TEST=no visible change, works when compiled against 10.6 SDK Review URL: http://codereview.chromium.org/2131010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47676 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_mac.mm')
-rw-r--r--base/process_util_mac.mm30
1 files changed, 27 insertions, 3 deletions
diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm
index 9fcc43c..602be56 100644
--- a/base/process_util_mac.mm
+++ b/base/process_util_mac.mm
@@ -231,7 +231,7 @@ bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes,
*shared_bytes = 0;
return true;
}
-
+
void ProcessMetrics::GetCommittedKBytes(CommittedKBytes* usage) const {
}
@@ -418,9 +418,33 @@ void oom_killer_new() {
// === Core Foundation CFAllocators ===
// This is the real structure of a CFAllocatorRef behind the scenes. See
-// http://opensource.apple.com/source/CF/CF-550/CFBase.c for details.
+// http://opensource.apple.com/source/CF/CF-476.19/CFBase.c (10.5.8) and
+// http://opensource.apple.com/source/CF/CF-550/CFBase.c (10.6) for details.
+struct ChromeCFRuntimeBase {
+ uintptr_t _cfisa;
+ uint8_t _cfinfo[4];
+#if __LP64__
+ uint32_t _rc;
+#endif
+};
+
struct ChromeCFAllocator {
- _malloc_zone_t fake_malloc_zone;
+ ChromeCFRuntimeBase cf_runtime_base;
+ size_t (*size)(struct _malloc_zone_t* zone, const void* ptr);
+ void* (*malloc)(struct _malloc_zone_t* zone, size_t size);
+ void* (*calloc)(struct _malloc_zone_t* zone, size_t num_items, size_t size);
+ void* (*valloc)(struct _malloc_zone_t* zone, size_t size);
+ void (*free)(struct _malloc_zone_t* zone, void* ptr);
+ void* (*realloc)(struct _malloc_zone_t* zone, void* ptr, size_t size);
+ void (*destroy)(struct _malloc_zone_t* zone);
+ const char* zone_name;
+ unsigned (*batch_malloc)(struct _malloc_zone_t* zone, size_t size,
+ void** results, unsigned num_requested);
+ void (*batch_free)(struct _malloc_zone_t* zone, void** to_be_freed,
+ unsigned num_to_be_freed);
+ struct malloc_introspection_t* introspect;
+ void* reserved5;
+
void* allocator;
CFAllocatorContext context;
};