jemalloc_stub.c revision 1.1
1/*-
2 * Copyright (c) 2019 The NetBSD Foundation, Inc.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The NetBSD Foundation
6 * by Christos Zoulas.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 */
29#include <malloc.h>
30
31void *__je_mallocx(size_t, int);
32void *
33mallocx(size_t l, int f)
34{
35	return __je_mallocx(l, f);
36}
37
38void *__je_rallocx(void *, size_t, int);
39void *
40rallocx(void *p, size_t l, int f)
41{
42	return __je_rallocx(p, l, f);
43}
44
45size_t __je_xallocx(void *, size_t, size_t, int);
46size_t
47xallocx(void *p, size_t l, size_t s, int f)
48{
49	return __je_xallocx(p, l, s, f);
50}
51
52size_t __je_sallocx(const void *, int);
53size_t
54sallocx(const void *p, int f)
55{
56	return __je_sallocx(p, f);
57}
58
59void __je_dallocx(void *, int);
60void
61dallocx(void *p, int f)
62{
63	__je_dallocx(p, f);
64}
65
66void __je_sdallocx(void *, size_t, int);
67void
68sdallocx(void *p, size_t l, int f)
69{
70	__je_sdallocx(p, l, f);
71}
72
73size_t __je_nallocx(size_t, int);
74size_t
75nallocx(size_t l, int f)
76{
77	return __je_nallocx(l, f);
78}
79
80int __je_mallctl(const char *, void *, size_t *, void *, size_t);
81int
82mallctl(const char *n, void *p, size_t *s, void *v, size_t l)
83{
84	return __je_mallctl(n, p, s, v, l);
85}
86
87int __je_mallctlnametomib(const char *, size_t *, size_t *);
88int
89mallctlnametomib(const char *n, size_t *l, size_t *s)
90{
91	return __je_mallctlnametomib(n, l, s);
92}
93
94int __je_mallctlbymib(const size_t *, size_t, void *, size_t *, void *, size_t);
95int
96mallctlbymib(const size_t *sp, size_t s, void *p , size_t *dp, void *r ,
97    size_t l)
98{
99	return __je_mallctlbymib(sp, s, p , dp, r, l);
100}
101
102void __je_malloc_stats_print(void (*)(void *, const char *), void *,
103    const char *);
104void
105malloc_stats_print(void (*f)(void *, const char *), void *p, const char *n)
106{
107	__je_malloc_stats_print(f, p, n);
108}
109
110size_t __je_malloc_usable_size(const void *);
111size_t
112malloc_usable_size(const void *p)
113{
114    return __je_malloc_usable_size(p);
115}
116void (*__je_malloc_message_get(void))(void *, const char *);
117void (*
118malloc_message_get(void))(void *, const char *)
119{
120	return __je_malloc_message_get();
121}
122
123void __je_malloc_message_set(void (*)(void *, const char *));
124void
125malloc_message_set(void (*m)(void *, const char *))
126{
127	__je_malloc_message_set(m);
128}
129
130const char *__je_malloc_conf_get(void);
131const char *
132malloc_conf_get(void)
133{
134	return __je_malloc_conf_get();
135}
136
137void __je_malloc_conf_set(const char *);
138void malloc_conf_set(const char *m)
139{
140	__je_malloc_conf_set(m);
141}
142