1 .\" Copyright (c) 2008 Apple, Inc. All rights reserved.
3 .\" @APPLE_LICENSE_HEADER_START@
5 .\" The contents of this file constitute Original Code as defined in and
6 .\" are subject to the Apple Public Source License Version 1.1 (the
7 .\" "License"). You may not use this file except in compliance with the
8 .\" License. Please obtain a copy of the License at
9 .\" http://www.apple.com/publicsource and read it before using this file.
11 .\" This Original Code and all software distributed under the License are
12 .\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
13 .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
14 .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
15 .\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
16 .\" License for the specific language governing rights and limitations
17 .\" under the License.
19 .\" @APPLE_LICENSE_HEADER_END@
22 .Dt MALLOC_ZONE_MALLOC 3
25 .Nm malloc_create_zone ,
26 .Nm malloc_destroy_zone ,
27 .Nm malloc_default_zone ,
28 .Nm malloc_zone_from_ptr ,
29 .Nm malloc_zone_malloc ,
30 .Nm malloc_zone_calloc ,
31 .Nm malloc_zone_valloc ,
32 .Nm malloc_zone_realloc ,
33 .Nm malloc_zone_memalign ,
35 .Nd zone-based memory allocation
39 .Fo malloc_create_zone
40 .Fa "vm_size_t start_size"
44 .Fo malloc_destroy_zone
45 .Fa "malloc_zone_t *zone"
48 .Fo malloc_default_zone
52 .Fo malloc_zone_from_ptr
56 .Fo malloc_zone_malloc
57 .Fa "malloc_zone_t *zone"
61 .Fo malloc_zone_calloc
62 .Fa "malloc_zone_t *zone"
63 .Fa "size_t num_items"
67 .Fo malloc_zone_valloc
68 .Fa "malloc_zone_t *zone"
72 .Fo malloc_zone_realloc
73 .Fa "malloc_zone_t *zone"
78 .Fo malloc_zone_memalign
79 .Fa "malloc_zone_t *zone"
80 .Fa "size_t alignment"
85 .Fa "malloc_zone_t *zone"
90 .Fn malloc_create_zone
91 function creates a malloc zone, advising an initial allocation of
95 that alter the standard behavior of the zone.
96 The returned malloc zone can be used to provide custom allocation and
97 deallocation behavior, and to retrieve additional information about the
98 allocations in that zone.
101 .Fn malloc_destroy_zone
102 function deallocates all memory associated with objects in
109 .Fn malloc_default_zone
110 function returns the default system malloc zone, used by
116 .Fn malloc_zone_from_ptr
117 function returns a pointer to the malloc zone which contains
119 or NULL, if the pointer does not point to an allocated object in any current
123 .Fn malloc_zone_malloc ,
124 .Fn malloc_zone_calloc ,
125 .Fn malloc_zone_valloc ,
126 .Fn malloc_zone_realloc ,
127 .Fn malloc_zone_memalign ,
130 perform the same task on
132 as their non-prefixed variants,
137 .Xr posix_memalign 3 ,
139 .Xr free 3 perform on the default system malloc zone.
142 .Fn malloc_create_zone ,
143 .Fn malloc_default_zone ,
145 .Fn malloc_zone_from_ptr
146 functions return a pointer to a malloc_zone_t structure, or NULL if there was
150 .Fn malloc_zone_malloc ,
151 .Fn malloc_zone_calloc ,
152 .Fn malloc_zone_valloc ,
153 .Fn malloc_zone_realloc ,
155 .Fn malloc_zone_memalign
156 functions return a pointer to allocated memory. If there is an error, they
157 return a NULL pointer. They are not required to set