1 
2 #ifndef __MALLOC_H
3 #define __MALLOC_H
4 #include <features.h>
5 #include <sys/types.h>
6 
7 /*
8  * Mini malloc allows you to use a less efficient but smaller malloc the
9  * cost is about 100 bytes of code in free but malloc (700bytes) doesn't
10  * have to be linked. Unfortunatly memory can only be reused if everything
11  * above it has been freed
12  *
13  */
14 
15 extern void free __P((void *));
16 extern void *malloc __P((size_t));
17 extern void *realloc __P((void *, size_t));
18 extern void *alloca __P((size_t));
19 
20 extern void *(*__alloca_alloc) __P((size_t));
21 
22 #ifdef __LIBC__
23 #define __MINI_MALLOC__
24 #endif
25 
26 #ifdef __MINI_MALLOC__
27 #define malloc(x) ((*__alloca_alloc)(x))
28 #endif
29 
30 #endif
31