1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
14 */
15
16 #include <sys/kmem.h>
17
18 #include <sys/debug.h>
19 #include <sys/ksynch.h>
20 #include <sys/systm.h>
21
22 #include <umem.h>
23
24 void abort(void) __NORETURN;
25
26 static int
27 kmem_failed_cb(void)
28 {
29 abort();
30 return (UMEM_CALLBACK_RETRY);
31 }
32
33 #pragma init(_kmem_init)
111
112 void *
113 kmem_cache_alloc(kmem_cache_t *kc, int kmflags)
114 {
115 return (umem_cache_alloc((umem_cache_t *)kc,
116 kmem2umem_flags(kmflags)));
117 }
118
119 void
120 kmem_cache_free(kmem_cache_t *kc, void *p)
121 {
122 umem_cache_free((umem_cache_t *)kc, p);
123 }
124
125 /* ARGSUSED */
126 void
127 kmem_cache_set_move(kmem_cache_t *kc,
128 kmem_cbrc_t (*fun)(void *, void *, size_t, void *))
129 {
130 }
131
132 /* ARGSUSED */
133 void
134 kmem_cache_reap_now(kmem_cache_t *kc)
135 {
136 }
137
138 /* uint64_t kmem_cache_stat(kmem_cache_t *, char *); */
139
140 /* ARGSUSED */
141 void
142 vmem_qcache_reap(struct vmem *vmp)
143 {
144 }
145
146 void
147 strfree(char *str)
148 {
149 ASSERT(str != NULL);
150 kmem_free(str, strlen(str) + 1);
|
1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
14 * Copyright (c) 2017, Joyent, Inc.
15 */
16
17 #include <sys/kmem.h>
18
19 #include <sys/debug.h>
20 #include <sys/ksynch.h>
21 #include <sys/systm.h>
22
23 #include <umem.h>
24
25 void abort(void) __NORETURN;
26
27 static int
28 kmem_failed_cb(void)
29 {
30 abort();
31 return (UMEM_CALLBACK_RETRY);
32 }
33
34 #pragma init(_kmem_init)
112
113 void *
114 kmem_cache_alloc(kmem_cache_t *kc, int kmflags)
115 {
116 return (umem_cache_alloc((umem_cache_t *)kc,
117 kmem2umem_flags(kmflags)));
118 }
119
120 void
121 kmem_cache_free(kmem_cache_t *kc, void *p)
122 {
123 umem_cache_free((umem_cache_t *)kc, p);
124 }
125
126 /* ARGSUSED */
127 void
128 kmem_cache_set_move(kmem_cache_t *kc,
129 kmem_cbrc_t (*fun)(void *, void *, size_t, void *))
130 {
131 }
132
133 boolean_t
134 kmem_cache_reap_active(void)
135 {
136 return (B_FALSE);
137 }
138
139 /* ARGSUSED */
140 void
141 kmem_cache_reap_soon(kmem_cache_t *kc)
142 {
143 }
144
145 /* ARGSUSED */
146 void
147 kmem_cache_reap_now(kmem_cache_t *kc)
148 {
149 }
150
151 /* uint64_t kmem_cache_stat(kmem_cache_t *, char *); */
152
153 /* ARGSUSED */
154 void
155 vmem_qcache_reap(struct vmem *vmp)
156 {
157 }
158
159 void
160 strfree(char *str)
161 {
162 ASSERT(str != NULL);
163 kmem_free(str, strlen(str) + 1);
|