Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
4ceecbd9dff046d704be2fe9223e93174cdff490
[simgrid.git] / src / mc / mc_mmalloc.h
1 /* Copyright (c) 2007-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef MC_MMALLOC_H
8 #define MC_MMALLOC_H
9
10 #include <xbt/mmalloc.h>
11
12 /** file
13  *  Support for seperate heaps.
14  *
15  *  The possible memory modes for the modelchecker are standard and raw.
16  *  Normally the system should operate in std, for switching to raw mode
17  *  you must wrap the code between MC_SET_RAW_MODE and MC_UNSET_RAW_MODE.
18  */
19  
20 extern xbt_mheap_t std_heap;
21 extern xbt_mheap_t mc_heap;
22
23 /* FIXME: Horrible hack! because the mmalloc library doesn't provide yet of */
24 /* an API to query about the status of a heap, we simply call mmstats and */
25 /* because I now how does structure looks like, then I redefine it here */
26
27 /* struct mstats { */
28 /*   size_t bytes_total;           /\* Total size of the heap. *\/ */
29 /*   size_t chunks_used;           /\* Chunks allocated by the user. *\/ */
30 /*   size_t bytes_used;            /\* Byte total of user-allocated chunks. *\/ */
31 /*   size_t chunks_free;           /\* Chunks in the free list. *\/ */
32 /*   size_t bytes_free;            /\* Byte total of chunks in the free list. *\/ */
33 /* }; */
34
35 #define MC_SET_MC_HEAP    mmalloc_set_current_heap(mc_heap)
36 #define MC_SET_STD_HEAP  mmalloc_set_current_heap(std_heap)
37
38 #endif