OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 Apple Inc. All rights reserved. | 2 * Copyright (c) 2011 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const char *zone_name; | 43 const char *zone_name; |
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) */ | 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) */ |
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 */ | 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 */ |
46 struct malloc_introspection_t *introspect; | 46 struct malloc_introspection_t *introspect; |
47 void *reserved5; | 47 void *reserved5; |
48 #endif | 48 #endif |
49 CFAllocatorRef _allocator; | 49 CFAllocatorRef _allocator; |
50 CFAllocatorContext _context; | 50 CFAllocatorContext _context; |
51 }; | 51 }; |
52 | 52 |
53 // TODO(avi): verify that this is accurate for 10.8 upon source release; http://
crbug.com/117476 | |
54 struct ChromeCFAllocatorLions { | 53 struct ChromeCFAllocatorLions { |
55 ChromeCFRuntimeBase _base; | 54 ChromeCFRuntimeBase _base; |
56 #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED | 55 #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED |
57 size_t (*size)(struct _malloc_zone_t *zone, const void *ptr); /* return
s the size of a block or 0 if not in this zone; must be fast, especially for neg
ative answers */ | 56 size_t (*size)(struct _malloc_zone_t *zone, const void *ptr); /* return
s the size of a block or 0 if not in this zone; must be fast, especially for neg
ative answers */ |
58 void *(*malloc)(struct _malloc_zone_t *zone, size_t size); | 57 void *(*malloc)(struct _malloc_zone_t *zone, size_t size); |
59 void *(*calloc)(struct _malloc_zone_t *zone, size_t num_items, size_t
size); /* same as malloc, but block returned is set to zero */ | 58 void *(*calloc)(struct _malloc_zone_t *zone, size_t num_items, size_t
size); /* same as malloc, but block returned is set to zero */ |
60 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
*/ | 59 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
*/ |
61 void (*free)(struct _malloc_zone_t *zone, void *ptr); | 60 void (*free)(struct _malloc_zone_t *zone, void *ptr); |
62 void *(*realloc)(struct _malloc_zone_t *zone, void *ptr, size_t size)
; | 61 void *(*realloc)(struct _malloc_zone_t *zone, void *ptr, size_t size)
; |
63 void (*destroy)(struct _malloc_zone_t *zone); /* zone is destroyed an
d all memory reclaimed */ | 62 void (*destroy)(struct _malloc_zone_t *zone); /* zone is destroyed an
d all memory reclaimed */ |
(...skipping 10 matching lines...) Expand all Loading... |
74 void *(*memalign)(struct _malloc_zone_t *zone, size_t alignment, size_t
size); | 73 void *(*memalign)(struct _malloc_zone_t *zone, size_t alignment, size_t
size); |
75 | 74 |
76 /* free a pointer known to be in zone and known to have the given size. The
callback may be NULL. */ | 75 /* free a pointer known to be in zone and known to have the given size. The
callback may be NULL. */ |
77 void (*free_definite_size)(struct _malloc_zone_t *zone, void *ptr, size_t si
ze); | 76 void (*free_definite_size)(struct _malloc_zone_t *zone, void *ptr, size_t si
ze); |
78 #endif | 77 #endif |
79 CFAllocatorRef _allocator; | 78 CFAllocatorRef _allocator; |
80 CFAllocatorContext _context; | 79 CFAllocatorContext _context; |
81 }; | 80 }; |
82 | 81 |
83 #endif // THIRD_PARTY_APPLE_APSL_CFBASE_H_ | 82 #endif // THIRD_PARTY_APPLE_APSL_CFBASE_H_ |
OLD | NEW |