1/* 2 * Copyright (c) 2002, Jeffrey Roberson <jroberson@chesapeake.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/vm/uma.h 95766 2002-04-30 04:26:34Z jeff $ |
27 * 28 */ 29 30/* 31 * uma.h - External definitions for the Universal Memory Allocator 32 * 33 * Jeff Roberson <jroberson@chesapeake.net> 34*/ --- 158 unchanged lines hidden (view full) --- 193void uma_zdestroy(uma_zone_t zone); 194 195/* 196 * Allocates an item out of a zone 197 * 198 * Arguments: 199 * zone The zone we are allocating from 200 * arg This data is passed to the ctor function |
201 * flags See sys/malloc.h for available flags. |
202 * 203 * Returns: 204 * A non null pointer to an initialized element from the zone is 205 * garanteed if the wait flag is M_WAITOK, otherwise a null pointer may be 206 * returned if the zone is empty or the ctor failed. 207 */ 208 |
209void *uma_zalloc_arg(uma_zone_t zone, void *arg, int flags); |
210 211/* 212 * Allocates an item out of a zone without supplying an argument 213 * 214 * This is just a wrapper for uma_zalloc_arg for convenience. 215 * 216 */ |
217static __inline void *uma_zalloc(uma_zone_t zone, int flags); |
218 219static __inline void * |
220uma_zalloc(uma_zone_t zone, int flags) |
221{ |
222 return uma_zalloc_arg(zone, NULL, flags); |
223} 224 225/* 226 * Frees an item back into the specified zone. 227 * 228 * Arguments: 229 * zone The zone the item was originally allocated out of. 230 * item The memory to be freed. --- 195 unchanged lines hidden --- |