Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
we don't need any stats about the amount of free chunks and such
[simgrid.git] / include / xbt / mmalloc.h
1 #ifndef MMALLOC_H
2 #define MMALLOC_H 1
3
4 #ifdef HAVE_STDDEF_H
5 #  include <stddef.h>
6 #else
7 #  include <sys/types.h>        /* for size_t */
8 #  include <stdio.h>            /* for NULL */
9 #endif
10 //#include "./include/ansidecl.h"
11
12 /* Allocate SIZE bytes of memory.  */
13
14 extern void *mmalloc(void *md, size_t size);
15
16 /* Re-allocate the previously allocated block in void*, making the new block
17    SIZE bytes long.  */
18
19 extern void *mrealloc(void *md, void *ptr, size_t size);
20
21 /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0.  */
22
23 extern void *mcalloc(void *md, size_t nmemb, size_t size);
24
25 /* Free a block allocated by `mmalloc', `mrealloc' or `mcalloc'.  */
26
27 extern void mfree(void *md, void *ptr);
28
29 /* Allocate SIZE bytes allocated to ALIGNMENT bytes.  */
30
31 extern void *mmemalign(void *md, size_t alignment, size_t size);
32
33 /* Allocate SIZE bytes on a page boundary.  */
34
35 extern void *mvalloc(void *md, size_t size);
36
37 extern void *mmalloc_attach(int fd, void *baseaddr);
38
39 extern void mmalloc_pre_detach(void *md);
40
41 extern void *mmalloc_detach(void *md);
42
43 extern int mmalloc_setkey(void *md, int keynum, void *key);
44
45 extern void *mmalloc_getkey(void *md, int keynum);
46
47 /* return the heap used when NULL is passed as first argument to any mm* function */
48 extern void *mmalloc_get_default_md(void);
49
50 extern int mmtrace(void);
51
52 extern void *mmalloc_findbase(int size);
53
54 extern int mmalloc_compare_heap(void *h1, void *h2, void *std_heap_addr);
55
56 extern void mmalloc_display_info_heap(void *h);
57
58 /* To change the heap used when using the legacy version malloc/free/realloc and such */
59 void mmalloc_set_current_heap(void *new_heap);
60 void *mmalloc_get_current_heap(void);
61
62
63
64 #endif                          /* MMALLOC_H */