10 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory, mc,
11 "Logging specific to MC (memory)");
13 /* Pointers to each of the heap regions to use */
14 void *std_heap = NULL; /* memory erased each time the MC stuff rollbacks to the beginning. Almost everything goes here */
15 void *raw_heap = NULL; /* memory persistent over the MC rollbacks. Only MC stuff should go there */
17 /* Initialize the model-checker memory subsystem */
18 /* It creates the two heap regions: std_heap and raw_heap */
21 /* Create the first region HEAP_OFFSET bytes after the heap break address */
22 std_heap = mmalloc_get_default_md();
23 xbt_assert(std_heap != NULL);
25 /* Create the second region a page after the first one ends + safety gap */
26 /* raw_heap_fd = shm_open("raw_heap", O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);*/
27 raw_heap = mmalloc_attach(-1, (char*)(std_heap) + STD_HEAP_SIZE + getpagesize());
28 xbt_assert(raw_heap != NULL);
31 /* Finish the memory subsystem */
32 #include "xbt_modinter.h"
33 void MC_memory_exit(void)
36 mmalloc_detach(raw_heap);