7 # include <sys/types.h> /* for size_t */
8 # include <stdio.h> /* for NULL */
10 //#include "./include/ansidecl.h"
12 /* Allocate SIZE bytes of memory. */
14 extern void *mmalloc(void *md, size_t size);
16 /* Re-allocate the previously allocated block in void*, making the new block
19 extern void *mrealloc(void *md, void *ptr, size_t size);
21 /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
23 extern void *mcalloc(void *md, size_t nmemb, size_t size);
25 /* Free a block allocated by `mmalloc', `mrealloc' or `mcalloc'. */
27 extern void mfree(void *md, void *ptr);
29 /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
31 extern void *mmemalign(void *md, size_t alignment, size_t size);
33 /* Allocate SIZE bytes on a page boundary. */
35 extern void *mvalloc(void *md, size_t size);
37 /* Pick up the current statistics. (see FIXME elsewhere) */
39 extern struct mstats mmstats(void *md);
41 extern void *mmalloc_attach(int fd, void *baseaddr);
43 extern void mmalloc_pre_detach(void *md);
45 extern void *mmalloc_detach(void *md);
47 extern int mmalloc_setkey(void *md, int keynum, void *key);
49 extern void *mmalloc_getkey(void *md, int keynum);
51 // FIXME: this function is not implemented anymore?
52 //extern int mmalloc_errno (void* md);
54 /* return the heap used when NULL is passed as first argument to any mm* function */
55 extern void *mmalloc_get_default_md(void);
57 extern int mmtrace(void);
59 extern void *mmalloc_findbase(int size);
61 extern int mmalloc_compare_heap(void *h1, void *h2, void *std_heap_addr);
63 extern void mmalloc_display_info_heap(void *h);
65 /* To change the heap used when using the legacy version malloc/free/realloc and such */
66 void mmalloc_set_current_heap(void *new_heap);
67 void *mmalloc_get_current_heap(void);
71 #endif /* MMALLOC_H */