summaryrefslogtreecommitdiffstats
path: root/include/malloc_np.h
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2012-04-17 07:22:14 +0000
committerjasone <jasone@FreeBSD.org>2012-04-17 07:22:14 +0000
commitcbeacb7c46f3a3650e5dbefa9a1a18bc9943a8cc (patch)
tree24efdb5b31d087479e78f72f3b772bd5b02e470c /include/malloc_np.h
parent1bc364bf7eebf6139e4f968987974484d35c5cb4 (diff)
downloadFreeBSD-src-cbeacb7c46f3a3650e5dbefa9a1a18bc9943a8cc.zip
FreeBSD-src-cbeacb7c46f3a3650e5dbefa9a1a18bc9943a8cc.tar.gz
Import jemalloc 9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa (dev branch,
prior to 3.0.0 release) as contrib/jemalloc, and integrate it into libc. The code being imported by this commit diverged from lib/libc/stdlib/malloc.c in March 2010, which means that a portion of the jemalloc 1.0.0 ChangeLog entries are relevant, as are the entries for all subsequent releases.
Diffstat (limited to 'include/malloc_np.h')
-rw-r--r--include/malloc_np.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/malloc_np.h b/include/malloc_np.h
index bd45d19..699077f 100644
--- a/include/malloc_np.h
+++ b/include/malloc_np.h
@@ -33,9 +33,36 @@
#define _MALLOC_NP_H_
#include <sys/cdefs.h>
#include <sys/types.h>
+#include <strings.h>
__BEGIN_DECLS
size_t malloc_usable_size(const void *ptr);
+
+void malloc_stats_print(void (*write_cb)(void *, const char *),
+ void *cbopaque, const char *opts);
+int mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp,
+ size_t newlen);
+int mallctlnametomib(const char *name, size_t *mibp, size_t *miblenp);
+int mallctlbymib(const size_t *mib, size_t miblen, void *oldp,
+ size_t *oldlenp, void *newp, size_t newlen);
+
+#define ALLOCM_LG_ALIGN(la) (la)
+#define ALLOCM_ALIGN(a) (ffsl(a)-1)
+#define ALLOCM_ZERO ((int)0x40)
+#define ALLOCM_NO_MOVE ((int)0x80)
+
+#define ALLOCM_SUCCESS 0
+#define ALLOCM_ERR_OOM 1
+#define ALLOCM_ERR_NOT_MOVED 2
+
+int allocm(void **ptr, size_t *rsize, size_t size, int flags)
+ __attribute__(nonnull(1));
+int rallocm(void **ptr, size_t *rsize, size_t size, size_t extra,
+ int flags) __attribute__(nonnull(1));
+int sallocm(const void *ptr, size_t *rsize, int flags)
+ __attribute__(nonnull(1));
+int dallocm(void *ptr, int flags) __attribute__(nonnull(1));
+int nallocm(size_t *rsize, size_t size, int flags);
__END_DECLS
#endif /* _MALLOC_NP_H_ */
OpenPOWER on IntegriCloud