uma.h (129913) | uma.h (132987) |
---|---|
1/* 2 * Copyright (c) 2002, Jeffrey Roberson <jeff@freebsd.org> 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 * | 1/* 2 * Copyright (c) 2002, Jeffrey Roberson <jeff@freebsd.org> 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 129913 2004-06-01 01:36:26Z bmilekic $ | 26 * $FreeBSD: head/sys/vm/uma.h 132987 2004-08-02 00:18:36Z green $ |
27 * 28 */ 29 30/* 31 * uma.h - External definitions for the Universal Memory Allocator 32 * 33*/ 34 --- 14 unchanged lines hidden (view full) --- 49 50/* 51 * Item constructor 52 * 53 * Arguments: 54 * item A pointer to the memory which has been allocated. 55 * arg The arg field passed to uma_zalloc_arg 56 * size The size of the allocated item | 27 * 28 */ 29 30/* 31 * uma.h - External definitions for the Universal Memory Allocator 32 * 33*/ 34 --- 14 unchanged lines hidden (view full) --- 49 50/* 51 * Item constructor 52 * 53 * Arguments: 54 * item A pointer to the memory which has been allocated. 55 * arg The arg field passed to uma_zalloc_arg 56 * size The size of the allocated item |
57 * flags See zalloc flags |
|
57 * 58 * Returns: | 58 * 59 * Returns: |
59 * Nothing | 60 * 0 on success 61 * errno on failure |
60 * 61 * Discussion: 62 * The constructor is called just before the memory is returned 63 * to the user. It may block if necessary. 64 */ | 62 * 63 * Discussion: 64 * The constructor is called just before the memory is returned 65 * to the user. It may block if necessary. 66 */ |
65typedef void (*uma_ctor)(void *mem, int size, void *arg); | 67typedef int (*uma_ctor)(void *mem, int size, void *arg, int flags); |
66 67/* 68 * Item destructor 69 * 70 * Arguments: 71 * item A pointer to the memory which has been allocated. 72 * size The size of the item being destructed. 73 * arg Argument passed through uma_zfree_arg --- 9 unchanged lines hidden (view full) --- 83typedef void (*uma_dtor)(void *mem, int size, void *arg); 84 85/* 86 * Item initializer 87 * 88 * Arguments: 89 * item A pointer to the memory which has been allocated. 90 * size The size of the item being initialized. | 68 69/* 70 * Item destructor 71 * 72 * Arguments: 73 * item A pointer to the memory which has been allocated. 74 * size The size of the item being destructed. 75 * arg Argument passed through uma_zfree_arg --- 9 unchanged lines hidden (view full) --- 85typedef void (*uma_dtor)(void *mem, int size, void *arg); 86 87/* 88 * Item initializer 89 * 90 * Arguments: 91 * item A pointer to the memory which has been allocated. 92 * size The size of the item being initialized. |
93 * flags See zalloc flags |
|
91 * 92 * Returns: | 94 * 95 * Returns: |
93 * Nothing | 96 * 0 on success 97 * errno on failure |
94 * 95 * Discussion: 96 * The initializer is called when the memory is cached in the uma zone. 97 * this should be the same state that the destructor leaves the object in. 98 */ | 98 * 99 * Discussion: 100 * The initializer is called when the memory is cached in the uma zone. 101 * this should be the same state that the destructor leaves the object in. 102 */ |
99typedef void (*uma_init)(void *mem, int size); | 103typedef int (*uma_init)(void *mem, int size, int flags); |
100 101/* 102 * Item discard function 103 * 104 * Arguments: 105 * item A pointer to memory which has been 'freed' but has not left the 106 * zone's cache. 107 * size The size of the item being discarded. --- 399 unchanged lines hidden --- | 104 105/* 106 * Item discard function 107 * 108 * Arguments: 109 * item A pointer to memory which has been 'freed' but has not left the 110 * zone's cache. 111 * size The size of the item being discarded. --- 399 unchanged lines hidden --- |