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

