1/*
2 * The je_ prefix on the following public symbol declarations is an artifact
3 * of namespace management, and should be omitted in application code unless
4 * JEMALLOC_NO_DEMANGLE is defined (see jemalloc_mangle.h).
5 */
6extern JEMALLOC_EXPORT const char	*je_malloc_conf;
7extern JEMALLOC_EXPORT void		(*je_malloc_message)(void *cbopaque,
8    const char *s);
9
10JEMALLOC_EXPORT void	*je_malloc(size_t size) JEMALLOC_ATTR(malloc);
11JEMALLOC_EXPORT void	*je_calloc(size_t num, size_t size)
12    JEMALLOC_ATTR(malloc);
13JEMALLOC_EXPORT int	je_posix_memalign(void **memptr, size_t alignment,
14    size_t size) JEMALLOC_ATTR(nonnull(1));
15JEMALLOC_EXPORT void	*je_aligned_alloc(size_t alignment, size_t size)
16    JEMALLOC_ATTR(malloc);
17JEMALLOC_EXPORT void	*je_realloc(void *ptr, size_t size);
18JEMALLOC_EXPORT void	je_free(void *ptr);
19
20JEMALLOC_EXPORT void	*je_mallocx(size_t size, int flags);
21JEMALLOC_EXPORT void	*je_rallocx(void *ptr, size_t size, int flags);
22JEMALLOC_EXPORT size_t	je_xallocx(void *ptr, size_t size, size_t extra,
23    int flags);
24JEMALLOC_EXPORT size_t	je_sallocx(const void *ptr, int flags);
25JEMALLOC_EXPORT void	je_dallocx(void *ptr, int flags);
26JEMALLOC_EXPORT size_t	je_nallocx(size_t size, int flags);
27
28JEMALLOC_EXPORT int	je_mallctl(const char *name, void *oldp,
29    size_t *oldlenp, void *newp, size_t newlen);
30JEMALLOC_EXPORT int	je_mallctlnametomib(const char *name, size_t *mibp,
31    size_t *miblenp);
32JEMALLOC_EXPORT int	je_mallctlbymib(const size_t *mib, size_t miblen,
33    void *oldp, size_t *oldlenp, void *newp, size_t newlen);
34JEMALLOC_EXPORT void	je_malloc_stats_print(void (*write_cb)(void *,
35    const char *), void *je_cbopaque, const char *opts);
36JEMALLOC_EXPORT size_t	je_malloc_usable_size(
37    JEMALLOC_USABLE_SIZE_CONST void *ptr);
38
39#ifdef JEMALLOC_OVERRIDE_MEMALIGN
40JEMALLOC_EXPORT void *	je_memalign(size_t alignment, size_t size)
41    JEMALLOC_ATTR(malloc);
42#endif
43
44#ifdef JEMALLOC_OVERRIDE_VALLOC
45JEMALLOC_EXPORT void *	je_valloc(size_t size) JEMALLOC_ATTR(malloc);
46#endif
47
48typedef void *(chunk_alloc_t)(size_t, size_t, bool *, unsigned);
49typedef bool (chunk_dalloc_t)(void *, size_t, unsigned);
50