]> git.saurik.com Git - apple/xnu.git/blob - libsa/libsa/malloc.h
44638f139859c158c5aa3dfac3a03748aba45f9e
[apple/xnu.git] / libsa / libsa / malloc.h
1 #ifndef _LIBSA_MALLOC_H_
2 #define _LIBSA_MALLOC_H_
3
4 #include "stdlib.h"
5
6
7 /*****
8 * These functions are the minimum necessary for use
9 * by kld and its client.
10 */
11 void * malloc(size_t size);
12 void * realloc(void * address, size_t new_size);
13 void free(void * address);
14
15 void malloc_reset(void); // Destroy all memory regions
16
17
18 /*****
19 * These functions aren't compiled into the kernel.
20 * Their definitions are in the files malloc_debug
21 * and malloc_unused, in case they're ever needed.
22 */
23 #if 0
24 void free_all(void); // "Free" all memory blocks
25 size_t malloc_size(void * address);
26 int malloc_is_valid(void * address);
27
28 #ifdef DEBUG
29 size_t malloc_hiwat(void);
30 size_t malloc_current_usage(void);
31 size_t malloc_region_usage(void);
32 double malloc_peak_usage(void);
33 double malloc_min_usage(void);
34 size_t malloc_unused(void);
35 double malloc_current_efficiency(void);
36 void malloc_clear_hiwat(void);
37 void malloc_report(void);
38 int malloc_sanity_check(void);
39 #endif /* DEBUG */
40 #endif /* 0 */
41
42 #endif /* defined _LIBSA_MALLOC_H_ */