| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. | 2 * Copyright (c) 1999 Apple Computer, 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 27 matching lines...) Expand all Loading... |
| 38 void (*destroy)(struct _malloc_zone_t *zone); /* zone is destroyed an
d all memory reclaimed */ | 38 void (*destroy)(struct _malloc_zone_t *zone); /* zone is destroyed an
d all memory reclaimed */ |
| 39 const char *zone_name; | 39 const char *zone_name; |
| 40 | 40 |
| 41 /* Optional batch callbacks; these may be NULL */ | 41 /* Optional batch callbacks; these may be NULL */ |
| 42 unsigned (*batch_malloc)(struct _malloc_zone_t *zone, size_t size, void *
*results, unsigned num_requested); /* given a size, returns pointers capable of
holding that size; returns the number of pointers allocated (maybe 0 or less tha
n num_requested) */ | 42 unsigned (*batch_malloc)(struct _malloc_zone_t *zone, size_t size, void *
*results, unsigned num_requested); /* given a size, returns pointers capable of
holding that size; returns the number of pointers allocated (maybe 0 or less tha
n num_requested) */ |
| 43 void (*batch_free)(struct _malloc_zone_t *zone, void **to_be_freed, u
nsigned num_to_be_freed); /* frees all the pointers in to_be_freed; note that to
_be_freed may be overwritten during the process */ | 43 void (*batch_free)(struct _malloc_zone_t *zone, void **to_be_freed, u
nsigned num_to_be_freed); /* frees all the pointers in to_be_freed; note that to
_be_freed may be overwritten during the process */ |
| 44 | 44 |
| 45 struct malloc_introspection_t *introspect; | 45 struct malloc_introspection_t *introspect; |
| 46 unsigned version; | 46 unsigned version; |
| 47 | 47 |
| 48 /* aligned memory allocation. The callback may be NULL. */ | 48 /* aligned memory allocation. The callback may be NULL. Present in version >
= 5. */ |
| 49 » void *(*memalign)(struct _malloc_zone_t *zone, size_t alignment, size_t
size); // version >= 5 | 49 void *(*memalign)(struct _malloc_zone_t *zone, size_t alignment, size_t size
); |
| 50 | 50 |
| 51 /* free a pointer known to be in zone and known to have the given size. The
callback may be NULL. */ | 51 /* free a pointer known to be in zone and known to have the given size. The
callback may be NULL. Present in version >= 6.*/ |
| 52 void (*free_definite_size)(struct _malloc_zone_t *zone, void *ptr, size_t si
ze); // version >= 6 | 52 void (*free_definite_size)(struct _malloc_zone_t *zone, void *ptr, size_t si
ze); |
| 53 |
| 54 /* Empty out caches in the face of memory pressure. The callback may be NULL
. Present in version >= 8. */ |
| 55 size_t » (*pressure_relief)(struct _malloc_zone_t *zone, size_t goal); |
| 53 } ChromeMallocZone; | 56 } ChromeMallocZone; |
| 54 | 57 |
| 55 #endif // THIRD_PARTY_APPLE_APSL_MALLOC_H_ | 58 #endif // THIRD_PARTY_APPLE_APSL_MALLOC_H_ |
| OLD | NEW |