1 /* Copyright (c) 2008-2012 Da SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "mc_private.h"
15 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory, mc,
16 "Logging specific to MC (memory)");
18 /* Pointers to each of the heap regions to use */
19 void *std_heap = NULL; /* memory erased each time the MC stuff rollbacks to the beginning. Almost everything goes here */
20 void *raw_heap = NULL; /* memory persistent over the MC rollbacks. Only MC stuff should go there */
22 /* Initialize the model-checker memory subsystem */
23 /* It creates the two heap regions: std_heap and raw_heap */
26 /* Create the first region HEAP_OFFSET bytes after the heap break address */
27 std_heap = mmalloc_get_default_md();
28 xbt_assert(std_heap != NULL);
30 /* Create the second region a page after the first one ends + safety gap */
31 raw_heap = xbt_mheap_new(-1, (char*)(std_heap) + STD_HEAP_SIZE + getpagesize());
32 xbt_assert(raw_heap != NULL);
35 /* Finalize the memory subsystem */
36 #include "xbt_modinter.h"
37 void MC_memory_exit(void)
40 xbt_mheap_destroy(raw_heap);