OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2009 Apple Inc. All rights reserved. | 2 * Copyright (c) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * @APPLE_LICENSE_HEADER_START@ | 4 * @APPLE_LICENSE_HEADER_START@ |
5 * | 5 * |
6 * This file contains Original Code and/or Modifications of Original Code | 6 * This file contains Original Code and/or Modifications of Original Code |
7 * as defined in and that are subject to the Apple Public Source License | 7 * as defined in and that are subject to the Apple Public Source License |
8 * Version 2.0 (the 'License'). You may not use this file except in | 8 * Version 2.0 (the 'License'). You may not use this file except in |
9 * compliance with the License. Please obtain a copy of the License at | 9 * compliance with the License. Please obtain a copy of the License at |
10 * http://www.opensource.apple.com/apsl/ and read it before using this | 10 * http://www.opensource.apple.com/apsl/ and read it before using this |
(...skipping 12 matching lines...) Expand all Loading... | |
23 /* CFBase.c | 23 /* CFBase.c |
24 Copyright (c) 1998-2009, Apple Inc. All rights reserved. | 24 Copyright (c) 1998-2009, Apple Inc. All rights reserved. |
25 Responsibility: Christopher Kane | 25 Responsibility: Christopher Kane |
26 */ | 26 */ |
27 | 27 |
28 #ifndef THIRD_PARTY_APPLE_APSL_CFBASE_H_ | 28 #ifndef THIRD_PARTY_APPLE_APSL_CFBASE_H_ |
29 #define THIRD_PARTY_APPLE_APSL_CFBASE_H_ | 29 #define THIRD_PARTY_APPLE_APSL_CFBASE_H_ |
30 | 30 |
31 #include "CFRuntime.h" | 31 #include "CFRuntime.h" |
32 | 32 |
33 struct ChromeCFAllocator { | 33 struct ChromeCFAllocator9and10 { |
34 | |
35 | |
36 ChromeCFRuntimeBase _base; | 34 ChromeCFRuntimeBase _base; |
37 #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED | 35 #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED |
38 size_t (*size)(struct _malloc_zone_t *zone, const void *ptr); /* returns the size of a block or 0 if not in this zone; must be fast, especially for negative answers */ | 36 size_t (*size)(struct _malloc_zone_t *zone, const void *ptr); /* returns the size of a block or 0 if not in this zone; must be fast, especially for negative answers */ |
39 void *(*malloc)(struct _malloc_zone_t *zone, size_t size); | 37 void *(*malloc)(struct _malloc_zone_t *zone, size_t size); |
40 void *(*calloc)(struct _malloc_zone_t *zone, size_t num_items, size_t size); /* same as malloc, but block returned is set to zero */ | 38 void *(*calloc)(struct _malloc_zone_t *zone, size_t num_items, size_t size); /* same as malloc, but block returned is set to zero */ |
41 void *(*valloc)(struct _malloc_zone_t *zone, size_t size); /* same as malloc , but block returned is set to zero and is guaranteed to be page aligned */ | 39 void *(*valloc)(struct _malloc_zone_t *zone, size_t size); /* same as malloc , but block returned is set to zero and is guaranteed to be page aligned */ |
42 void (*free)(struct _malloc_zone_t *zone, void *ptr); | 40 void (*free)(struct _malloc_zone_t *zone, void *ptr); |
43 void *(*realloc)(struct _malloc_zone_t *zone, void *ptr, size_t size); | 41 void *(*realloc)(struct _malloc_zone_t *zone, void *ptr, size_t size); |
44 void (*destroy)(struct _malloc_zone_t *zone); /* zone is destroyed and all m emory reclaimed */ | 42 void (*destroy)(struct _malloc_zone_t *zone); /* zone is destroyed and all m emory reclaimed */ |
45 const char *zone_name; | 43 const char *zone_name; |
46 unsigned (*batch_malloc)(struct _malloc_zone_t *zone, size_t size, void **re sults, unsigned num_requested); /* given a size, returns pointers capable of hol ding that size; returns the number of pointers allocated (maybe 0 or less than n um_requested) */ | 44 unsigned (*batch_malloc)(struct _malloc_zone_t *zone, size_t size, void **re sults, unsigned num_requested); /* given a size, returns pointers capable of hol ding that size; returns the number of pointers allocated (maybe 0 or less than n um_requested) */ |
47 void (*batch_free)(struct _malloc_zone_t *zone, void **to_be_freed, unsigned num_to_be_freed); /* frees all the pointers in to_be_freed; note that to_be_fre ed may be overwritten during the process */ | 45 void (*batch_free)(struct _malloc_zone_t *zone, void **to_be_freed, unsigned num_to_be_freed); /* frees all the pointers in to_be_freed; note that to_be_fre ed may be overwritten during the process */ |
48 struct malloc_introspection_t *introspect; | 46 struct malloc_introspection_t *introspect; |
49 void *reserved5; | 47 void *reserved5; |
50 #endif | 48 #endif |
51 CFAllocatorRef _allocator; | 49 CFAllocatorRef _allocator; |
52 CFAllocatorContext _context; | 50 CFAllocatorContext _context; |
53 }; | 51 }; |
54 | 52 |
53 struct ChromeCFAllocator11 { | |
Mark Mentovai
2011/03/17 21:37:44
TODO to fix when we get some for-sure answers?
Avi (use Gerrit)
2011/03/17 22:09:17
Done.
| |
54 ChromeCFRuntimeBase _base; | |
55 void* presumedSizeFunctionPtr; | |
56 void* presumedMallocFunctionPtr; | |
57 void* presumedCallocFunctionPtr; | |
58 void* presumedVallocFunctionPtr; | |
59 void* presumedFreeFunctionPtr; | |
60 void* presumedReallocFunctionPtr; | |
61 void* presumedDestroyFunctionPtr; | |
62 const char *zone_name; | |
63 void* presumedBatchMallocFunctionPtr; | |
64 void* presumedBatchFreeFunctionPtr; | |
65 void* presumedIntrospectStructPtr; | |
66 void* unknown1; | |
Mark Mentovai
2011/03/17 21:37:44
As discussed.
Avi (use Gerrit)
2011/03/17 22:09:17
Done.
| |
67 void* unknown2; | |
68 void* unknown3; | |
69 CFAllocatorRef _allocator; | |
70 CFAllocatorContext _context; | |
71 }; | |
72 | |
55 #endif // THIRD_PARTY_APPLE_APSL_CFBASE_H_ | 73 #endif // THIRD_PARTY_APPLE_APSL_CFBASE_H_ |
OLD | NEW |