- pvoid_f_void_t new_f,
- void_f_pvoid_t free_f,
- void_f_pvoid_t reset_f) {
- xbt_assert0(size > 0, "size must be positive");
- xbt_assert0(new_f != NULL && free_f != NULL && reset_f != NULL,
- "invalid parameter");
- xbt_mallocator_t m = xbt_new0(s_xbt_mallocator_t, 1);
-
- m->objects = xbt_new0(void*, size);
+ pvoid_f_void_t new_f,
+ void_f_pvoid_t free_f,
+ void_f_pvoid_t reset_f)
+{
+
+
+ xbt_mallocator_t m;
+
+ xbt_assert(size > 0, "size must be positive");
+ xbt_assert(new_f != NULL && free_f != NULL
+ && reset_f != NULL, "invalid parameter");
+
+ /* Let's force 0 size mallocator! (Dirty hack, blame Martin :) ) */
+
+ /* mallocators and memory mess introduced by model-checking do not mix well together:
+ * The mallocator will give standard memory when we are using raw memory (so these blocks are killed on restore)
+ * and the contrary (so these blocks will leak accross restores)
+ */
+ if (MC_IS_ENABLED)
+ size = 0;
+
+ m = xbt_new0(s_xbt_mallocator_t, 1);
+ XBT_VERB("Create mallocator %p", m);
+ if (XBT_LOG_ISENABLED(xbt_mallocator, xbt_log_priority_verbose))
+ xbt_backtrace_display_current();
+
+ m->objects = xbt_new0(void *, MC_IS_ENABLED ? 1 : size);