Deleted Added
full compact
uma.h (249313) uma.h (251826)
1/*-
2 * Copyright (c) 2002, 2003, 2004, 2005 Jeffrey Roberson <jeff@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Bosko Milekic <bmilekic@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 2002, 2003, 2004, 2005 Jeffrey Roberson <jeff@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Bosko Milekic <bmilekic@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/vm/uma.h 249313 2013-04-09 17:43:48Z glebius $
27 * $FreeBSD: head/sys/vm/uma.h 251826 2013-06-17 03:43:47Z jeff $
28 *
29 */
30
31/*
32 * uma.h - External definitions for the Universal Memory Allocator
33 *
34*/
35

--- 83 unchanged lines hidden (view full) ---

119 *
120 * Discussion:
121 * This routine is called when memory leaves a zone and is returned to the
122 * system for other uses. It is the counter-part to the init function.
123 */
124typedef void (*uma_fini)(void *mem, int size);
125
126/*
28 *
29 */
30
31/*
32 * uma.h - External definitions for the Universal Memory Allocator
33 *
34*/
35

--- 83 unchanged lines hidden (view full) ---

119 *
120 * Discussion:
121 * This routine is called when memory leaves a zone and is returned to the
122 * system for other uses. It is the counter-part to the init function.
123 */
124typedef void (*uma_fini)(void *mem, int size);
125
126/*
127 * Import new memory into a cache zone.
128 */
129typedef int (*uma_import)(void *arg, void **store, int count, int flags);
130
131/*
132 * Free memory from a cache zone.
133 */
134typedef void (*uma_release)(void *arg, void **store, int count);
135
136/*
127 * What's the difference between initializing and constructing?
128 *
129 * The item is initialized when it is cached, and this is the state that the
130 * object should be in when returned to the allocator. The purpose of this is
131 * to remove some code which would otherwise be called on each allocation by
132 * utilizing a known, stable state. This differs from the constructor which
133 * will be called on EVERY allocation.
134 *

--- 76 unchanged lines hidden (view full) ---

211 * the only supported.
212 *
213 * Returns:
214 * Error on failure, 0 on success.
215 */
216int uma_zsecond_add(uma_zone_t zone, uma_zone_t master);
217
218/*
137 * What's the difference between initializing and constructing?
138 *
139 * The item is initialized when it is cached, and this is the state that the
140 * object should be in when returned to the allocator. The purpose of this is
141 * to remove some code which would otherwise be called on each allocation by
142 * utilizing a known, stable state. This differs from the constructor which
143 * will be called on EVERY allocation.
144 *

--- 76 unchanged lines hidden (view full) ---

221 * the only supported.
222 *
223 * Returns:
224 * Error on failure, 0 on success.
225 */
226int uma_zsecond_add(uma_zone_t zone, uma_zone_t master);
227
228/*
229 * Create cache-only zones.
230 *
231 * This allows uma's per-cpu cache facilities to handle arbitrary
232 * pointers. Consumers must specify the import and release functions to
233 * fill and destroy caches. UMA does not allocate any memory for these
234 * zones. The 'arg' parameter is passed to import/release and is caller
235 * specific.
236 */
237uma_zone_t uma_zcache_create(char *name, uma_ctor ctor, uma_dtor dtor,
238 uma_init zinit, uma_fini zfini, uma_import zimport,
239 uma_release zrelease, void *arg, int flags);
240
241/*
219 * Definitions for uma_zcreate flags
220 *
221 * These flags share space with UMA_ZFLAGs in uma_int.h. Be careful not to
222 * overlap when adding new features. 0xf0000000 is in use by uma_int.h.
223 */
224#define UMA_ZONE_PAGEABLE 0x0001 /* Return items not fully backed by
225 physical memory XXX Not yet */
226#define UMA_ZONE_ZINIT 0x0002 /* Initialize with zeros */

--- 431 unchanged lines hidden ---
242 * Definitions for uma_zcreate flags
243 *
244 * These flags share space with UMA_ZFLAGs in uma_int.h. Be careful not to
245 * overlap when adding new features. 0xf0000000 is in use by uma_int.h.
246 */
247#define UMA_ZONE_PAGEABLE 0x0001 /* Return items not fully backed by
248 physical memory XXX Not yet */
249#define UMA_ZONE_ZINIT 0x0002 /* Initialize with zeros */

--- 431 unchanged lines hidden ---