summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/malloc_np.h27
-rw-r--r--include/stdlib.h7
2 files changed, 30 insertions, 4 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_ */
diff --git a/include/stdlib.h b/include/stdlib.h
index 7aa5db6..b73a54f 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -155,7 +155,7 @@ _Noreturn void _Exit(int);
* If we're in a mode greater than C99, expose C11 functions.
*/
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
-void * aligned_alloc(size_t, size_t);
+void * aligned_alloc(size_t, size_t) __malloc_like;
int at_quick_exit(void (*)(void));
_Noreturn void
quick_exit(int);
@@ -228,9 +228,8 @@ int unlockpt(int);
#endif /* __XSI_VISIBLE */
#if __BSD_VISIBLE
-extern const char *_malloc_options;
-extern void (*_malloc_message)(const char *, const char *, const char *,
- const char *);
+extern const char *malloc_conf;
+extern void (*malloc_message)(void *, const char *);
/*
* The alloca() function can't be implemented in C, and on some
OpenPOWER on IntegriCloud